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.
Recursion in Hugo
Moderators: AArdvark, Ice Cream Jonsey
- Ice Cream Jonsey
- Posts: 30419
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
Recursion in Hugo
the dark and gritty...Ice Cream Jonsey!
- Flack
- Posts: 9146
- Joined: Tue Nov 18, 2008 3:02 pm
- Location: Oklahoma
- Contact:
- Tdarcos
- Posts: 9613
- Joined: Fri May 16, 2008 9:25 am
- Location: Arlington, Virginia
- Contact:
Re: Recursion in Hugo
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.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.
Given the general rise in expenses and fall in the typical standard of living, the future ain't what it used to be.
- Tdarcos
- Posts: 9613
- Joined: Fri May 16, 2008 9:25 am
- Location: Arlington, Virginia
- Contact:
Trap Code
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.Tdarcos wrote: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.Ice Cream Jonsey wrote:That caused the game to crash, as the above forms a loop. An endless loop!
Thanks, Bruce.
Given the general rise in expenses and fall in the typical standard of living, the future ain't what it used to be.
- Tdarcos
- Posts: 9613
- Joined: Fri May 16, 2008 9:25 am
- Location: Arlington, Virginia
- Contact:
"I'd give a million dollars just to be able to take a piss without it hurting."Flack wrote:Maybe he just had to piss really bad!
Like, really, really, really bad.
Like ...
10 print "really, "
20 goto 10
... bad.
- Hyman Roth, The Godfather, Part 2
Given the general rise in expenses and fall in the typical standard of living, the future ain't what it used to be.