Is there a way to see how many statements are being run in Greed?

Is there a way to see how many statements are being run in Greed?

It states that more than 4000 statements and our game will slow down, but it is not clear how to see how many have been run.


If you have more than 4000 in some frame, it shows you an error with the information of your first ‘violation’.
When you get it early, it usually means that it will become much worse when number of units/coins increases.
Actually it is good to store number of times your code was executed (like this.say(this.turn++) ) and display it. Knowing the frame rate, you can see how much frames you lost. As the frame rate for this level is 4, at 1min you will get 240 turns normally. If you get 200, then your code is still good. If you get 100, you will most likely never win because your code is paralysed by the analysis.

1 Like


that’s really useful :slight_smile:

is there a way to see the number of statements?

As it really is at mission critical times that the code may be going over the limit.

PS. for new players reading this, you need to use this code to use no_login_founds turn counter:

if(this.turn === undefined) this.turn = 0;

We’ll be working to get the statement counter and full debugger working again in this level this week, after which you’ll be able to not only see statements per call and number of calls from the spell debug toolbar, but you’ll be able to step through your program’s execution once more.