menu
Roblox Forum Archive
Home
User Search
Forums
Donate
search
settings
Home
User Search
Forums
Donate
launch
Go to User Dashboard
Forums
Scripters
recursion return bug?!?!?
chevron_left
chevron_left
chevron_left
of
1
chevron_right
chevron_right
chevron_right
recursion return bug?!?!?
coolsamoXD1234
Join Date: 2012-09-30
Post Count: 47
#159832075
Friday, April 10, 2015 6:08 AM GMT
function ReturnNine(StartZero) if StartZero == 9 then return StartZero else ReturnNine(StartZero+1) end end print(ReturnNine(0)) howfix?
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
Arkose
Join Date: 2013-05-26
Post Count: 745
#159832492
Friday, April 10, 2015 6:23 AM GMT
function ReturnNine(StartZero) if StartZero == 9 then return StartZero else return ReturnNine(StartZero+1) end end print(ReturnNine(0))
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
coolsamoXD1234
Join Date: 2012-09-30
Post Count: 47
#159832598
Friday, April 10, 2015 6:28 AM GMT
wat Why do you need to return the function? Why does returning the variable at the end of the recursion return empty?
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
ChiefDelta
Join Date: 2010-11-05
Post Count: 13071
#159834023
Friday, April 10, 2015 7:29 AM GMT
function returnNine(startZero) if startZero == 9 then return StartZero end returnNine(startZero + 1) end print(returnNine(0))
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
Arkose
Join Date: 2013-05-26
Post Count: 745
#159834599
Friday, April 10, 2015 7:55 AM GMT
Idk how my extra end got in there.
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
KapKing47
Join Date: 2012-09-09
Post Count: 5522
#159839514
Friday, April 10, 2015 11:08 AM GMT
lol too many end's XDDD I remember making that mistake, well, back in the days I didnt know much about end's XD "My Life is going Good... but..."
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
Arkose
Join Date: 2013-05-26
Post Count: 745
#159899530
Saturday, April 11, 2015 3:50 AM GMT
I just assumed that my code had an extra end, didn't even read it. Turns out I didn't have an extra end and the code works fine. Also @chief, that wouldn't output nine.
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
chevron_left
chevron_left
chevron_left
of
1
chevron_right
chevron_right
chevron_right