Mistake in randomtest I can't figure out

Hey, I have a mistake I can’t figure out in randomtest. I’m sure it’s an obvious thing, but I just don’t see it. Because of that I have added some screenshots so one of you might be able to help me out. (I really like randomtest since it finds a lot of mistakes). I would have had the program write it all out, but it finds the mistake at seed 2110 and firefoxs crashes when I try that.

First one, showing the error, going from a choice in line 4503 suddenly back to line 1070, no idea why.

Line 4503

and line 1070

If you see the mistake, place let me know. Sorry if the images are unclear.

Uh, first check for a duplicate *label whowillleadthetrap backwards from line 1070 (although I think CS throws up errors for duplicate *labels, so that’s mostly a formality).

Second, try running it’s choices by hand and see where that puts you. (if you end up at the right choice, that indicates a problem with randomtext, while if you hit the one at 1070, it’s gotta be in your code.)

1 Like

Well, the labels are correct, so I guess I will go by hand. Thanks for looking, will let you know what I find (or can’t find)

in chapter_2_choice_of_flags, change line 4514 to
*else
instead of
*if (regularrelgionariesforthetrap =1) or (usemixforthetrap =1)

1 Like

Well, changing it to else fixed it. Not sure why it did, but it did. If anyone can explain to me why I would love to hear it.

But more importantly, thank you Reaperoa and JimD.

It’s an issue with the way the automated tests work, not with the code you used. Dan Fabulich calls it the Fake Bug. Here’s more info:

Such an issue has foiled many a game developer :wink:

@JimD Well, I guess I will just pretend that the program got jealous of my amazing coding skills and decided to see if it could slow me down. And yes it could. But I’m glad the program is working properly again.

Also, thanks for the link, looked at it and then decided that since it worked I am just going to be happy with that.

1 Like

Fair enough, but speaking only for my own game’s code, this wasn’t something that just popped up once. :slight_smile:

In my experience, the sooner you figure out when the automatic testers want you to finish with an *else, the happier you’ll be and the fewer hours you’ll spend running and re-running Random and QuickTest.

@Havenstone True enough. Both are importent if you want it have your work opperate properly. I’m now about 160K into my writing and those two programs have helped me a lot. Anyway, I did actually read it and understood a reasonable part of it and should I run into another problem I will consult it first. My problem here was example 3 and fix 4.

But my main wonder has why it jumped back so far in the game even if there were no labels that could explain it. Still not certain about that, but it doesn’t really matter since that problem has been fixed and the game works as it should at the moment.

In case this sounds hostile towards you I’m sorry, I do mean it in a friendly way.

To message below, it did come across as friendly :slightly_smiling:

1 Like

Not hostile at all. :slight_smile: Hope mine also came across as friendly.

1 Like