The Dink Network

Reply to Re: Variable Isolation

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
May 3rd 2010, 01:46 PM
bonca.gif
Erwin
Peasant He/Him Netherlands
Friendship is magic 
Attach this script to a sprite and talk to it to test it.

void talk (void)
{
int &n4 = 1;

//&n3 is the number you want counted from right to left.
//In this example we want the 4 in 126532485 which is the 3rd number.
int &n3 = 3;

if (&n3 > 1)
{
loop:

&n4 *= 10
&n3 -= 1

if (&n3 > 1)
{
goto loop;
}

}

//&n1 is the number you're taking a number from being 126532485 in this example
int &n1 = 126532485;
int &n2 = &n1;

&n2 /= &n4;

&n4 *= 10;
&n1 /= &n4;

&n1 *= 10;

&n2 -= &n1;

//Showing the outcome.
say_stop("&n2", &current_sprite);
}


Just as I finished this I saw that metatarasal beat me to it so I haven't really checked his script yet.