Skip to main content

Timeline for Guess my Number - Code Golf

Current License: CC BY-SA 3.0

20 events
when toggle format what by license comment
Apr 13, 2013 at 6:10 comment added Denys Séguret I had found this one, and a very similar I used in some iterations for distinction between 0 and not 0 : '=+'[u/u|0].
Apr 12, 2013 at 23:15 comment added mellamokb I was unsuccessful at making it shorter, but I did find an alternate expression for u=r-prompt(u<0?'-':'+'); if someone wants to try and explore it further: u=r-prompt('+-'[u<0|0]);.
Apr 12, 2013 at 16:11 history edited Denys Séguret CC BY-SA 3.0
deleted 2 characters in body
Apr 12, 2013 at 16:11 comment added Denys Séguret @XzKto Right. I edit :)
Apr 12, 2013 at 13:33 comment added XzKto Nice one, +1! Btw, you can save two more characters by doing "u=r=1+new Date%100" as we don't really care about starting value of u.
Apr 12, 2013 at 7:36 history edited Denys Séguret CC BY-SA 3.0
deleted 7 characters in body
Apr 12, 2013 at 7:24 history edited Denys Séguret CC BY-SA 3.0
deleted 5 characters in body
Apr 12, 2013 at 7:10 history edited Denys Séguret CC BY-SA 3.0
added 3 characters in body
Apr 12, 2013 at 7:05 history rollback Denys Séguret
Rollback to Revision 5
Apr 12, 2013 at 6:22 history edited Denys Séguret CC BY-SA 3.0
deleted 5 characters in body
Apr 11, 2013 at 17:59 comment added Denys Séguret I must leave for a moment. But this version should work (less user friendly, though).
Apr 11, 2013 at 17:58 history edited Denys Séguret CC BY-SA 3.0
added 3 characters in body
Apr 11, 2013 at 17:54 history rollback Denys Séguret
Rollback to Revision 2
Apr 11, 2013 at 17:50 comment added manatwork You can save 1 character by using a reference to prompt(): first p=prompt, then just p(). But something is wrong with the logic, as the “=” only appears if you guess the number on first try.
Apr 11, 2013 at 17:44 comment added Denys Séguret @manatwork I edited for the = too. Much less elegant. I'll try later to make it shorter.
Apr 11, 2013 at 17:41 comment added Denys Séguret @manatwork now I guess I can read the rules :) I edited for the 1..100.
Apr 11, 2013 at 17:40 history edited Denys Séguret CC BY-SA 3.0
added 2 characters in body
Apr 11, 2013 at 17:39 comment added manatwork Nice one! Even if skips some of the rules: uses 0..99 interval instead of 1..100 and not displays “=” on success.
Apr 11, 2013 at 17:32 history edited Denys Séguret CC BY-SA 3.0
edited body
Apr 11, 2013 at 17:26 history answered Denys Séguret CC BY-SA 3.0