This one drives me crazy. It must be something stupid simple, but I can't get my head around it.
I have a function shuffle with three params. Params(1) and Params(2) are the boundaries for a random number. Simple:
set randomPiece to round( random(shuffle.Param(1), shuffle.Param(2) ) )[/code:2ng7jv49]
The following should work too, but they don't:
[code:2ng7jv49]set randomPiece to int( random(shuffle.Param(1), shuffle.Param(2) ) )
set randomPiece to floor( random(shuffle.Param(1), shuffle.Param(2) ) )
The game simply doesn't start (black screen) and I get sometimes a browser error "Uncaught TypeError: Cannot read property 'current_even ' of undefined" and I event can't close the browser window.
The function has a inner condition and calls itself in case the new random number is the same than the given shuffle.Params(0) param:
[b]Why is int() and floor() not working for me?[/b]
Edit: if I deactivate the inner condition (event 8) int() and floor() work