in reply to Number gussing game

juwaidah1990:

It doesn't appear to be slow on my machine. I wrapped a for loop around it to guess all the numbers, and it ran quite nicely--with the exception of the case of $target=100. You'll want to fix that!

...roboticus

Replies are listed 'Best First'.
Re^2: Number gussing game
by juwaidah1990 (Initiate) on Jun 28, 2007 at 21:55 UTC
    I remember I read about adding brackets after the function call but I just forgot to add them :D however, I don't like removing the ampersand, i think it helps distinguish the difference between user defined functions and built-in function... I will actually do that, even though I don't know a lot about the <=> :D but using -1, 0, and 1 makes more sense than using 0, 1, and 2... It's just that considering it's just a loop, i think it should run faster than this!