Recursion in Hugo

Post a reply


This question is a means of preventing automated form submissions by spambots.
Smilies
:smile: :sad: :eek: :shock: :cool: :-x :razz: :oops: :evil: :twisted: :wink: :idea: :arrow: :neutral: :mrgreen:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Recursion in Hugo

by Tdarcos » Fri Feb 10, 2012 4:36 am

Flack wrote:Maybe he just had to piss really bad!

Like, really, really, really bad.

Like ...

10 print "really, "
20 goto 10

... bad.
"I'd give a million dollars just to be able to take a piss without it hurting."
- Hyman Roth, The Godfather, Part 2

Trap Code

by Tdarcos » Fri Feb 10, 2012 4:26 am

Tdarcos wrote:
Ice Cream Jonsey wrote:That caused the game to crash, as the above forms a loop. An endless loop!
Thanks, Bruce.
Actually, you're lucky it's a subroutine call, this uses memory for the stack frame and makes the game (eventually) use all available memory. If it was a branch it would just hang.
I have a method I use - I'm writing a cross-reference for Pascal Programs, something that has been really weak compared with what was available back on mainframe compilers - is a "trap code". Any place where something is happening, a global variable called TrapCode is set to 0 the first time it is entering an area. Every time it passes through the critical area, TrapCode is incremented. If it's not supposed to get more than, say, 5 or 6 loops I'll set the check on TrapCode so that if it reaches 50, it raises a flag that causes it to print a message and pause until ENTER is pressed, allowing me to see when a runaway program occurs.

Re: Recursion in Hugo

by Tdarcos » Wed May 18, 2011 11:56 am

Ice Cream Jonsey wrote:I had some code that was like this:

location DoUrinate
{
Perform(&DoUrinate, hole01)
}

hole01 was in the room. Basically, One of the Bruces typed >piss in hole

That caused the game to crash, as the above forms a loop. An endless loop!

This was meant to be a blog post, but I have a billion things to do before my brother's inexplicable wedding, not the least of which is using the word inexplicable in most posts.

Thanks, Bruce.
Actually, you're lucky it's a subroutine call, this uses memory for the stack frame and makes the game (eventually) use all available memory. If it was a branch it would just hang.

by Flack » Tue May 17, 2011 9:15 pm

Maybe he just had to piss really bad!

Like, really, really, really bad.

Like ...

10 print "really, "
20 goto 10

... bad.

Recursion in Hugo

by Ice Cream Jonsey » Tue May 17, 2011 8:55 pm

I had some code that was like this:

location DoUrinate
{
Perform(&DoUrinate, hole01)
}

hole01 was in the room. Basically, One of the Bruces typed >piss in hole

That caused the game to crash, as the above forms a loop. An endless loop!

This was meant to be a blog post, but I have a billion things to do before my brother's inexplicable wedding, not the least of which is using the word inexplicable in most posts.

Thanks, Bruce.

Top