The Dink Network

Reply to Re: Storage capacity

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:
 
 
October 22nd 2018, 04:00 PM
duck.gif
toof
Peasant He/Him
I disagree. 
Second function, works fine within the screen, but there are some bugs when I go to the next one. Strange... I might or might not continue with this... Time is short...
void set_gvar(void)
{
	
	///////////////////////
	int &gvar = &story;
	///////////////////////
	
	// new global value
	int &innervar = 0;
	
	// inner var bit range
	int &rangestart = &arg1;
	int &rangeend = &arg2;
	int &value = &arg3;
	
	//rest global
	int &counter = 1;
	int &adder = 0;
	int &increment = 1;
	
	looptwo:
	if(&counter == 33)
	{
		wait(1);
		return(&innervar);
		wait(1);
		kill_this_task();
	}
	if(&counter < 33)
	{
		if(&counter == &rangestart)
		{
			inner_loop:
			if(&counter <= &rangeend)
			{
				&adder = math_mod(&value, 2);
				wait(1);
				&value / 2;
				wait(1);
				&gvar / 2;
				wait(1);
				&adder * &increment;
				wait(1);
				&increment * 2;
				wait(1);
				&innervar += &adder;
				wait(1);
				&counter += 1;
				wait(1);
                                goto inner_loop;
			}
		}
		else
		{
			&adder = math_mod(&gvar, 2);
			wait(1);
			&gvar / 2;
			wait(1);
			&adder * &increment;
			wait(1);
			&increment * 2;
			wait(1);
			&innervar += &adder;
			wait(1);
			&counter += 1;
			wait(1);
		}
		goto looptwo;
	}
}


Edit
Found a way to debug this, like humans are supposed to debug it in the 21st century. Few mistakes found.