Timeline for Number-guessing game in C#
Current License: CC BY-SA 3.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 5, 2018 at 10:46 | comment | added | Flater |
C# is not Java, you should use == to compare strings instead of Equals(), it's much more readable. Please come to my work and tell that to everyone else here. I work in Equals() territory :(
|
|
| Dec 29, 2013 at 12:06 | comment | added | Kyle |
The update is much improved. A few points: You can so without bools for _isCorrectGuess and _higher (good practice to say _isHigher so we know it's a boolean) - just while(true){} and if(hint == "higher"). Input valuation - I would consider an if/else if structure to check hint as lower, higher then yes (as this is least likely so why check unless the hint is not low/high), then the final else might ask the user to try again with valid input. At the moment input of foo will be interpreted as lower.
|
|
| Jul 30, 2012 at 18:59 | vote | accept | Aesir | ||
| Jul 30, 2012 at 18:59 | comment | added | Aesir | I made some of the changes you suggested here: gist.github.com/f5f7e57353e78ede7433 | |
| Jul 30, 2012 at 17:32 | comment | added | Aesir | No I hadn't heard of it before, thanks for the link. | |
| Jul 30, 2012 at 17:17 | comment | added | svick | You mean you don't know the big O notation? In that case, read this answer on SO, it explains in quite a detail, but in plain English. If you want to write fast algorithms, it's quite important to understand the time complexity (which is what the big O represents here) of the algorithm. | |
| Jul 30, 2012 at 17:04 | comment | added | Aesir | Sorry if this seems like a silly question but what is meant by O(n log n)? | |
| Jul 30, 2012 at 9:33 | comment | added | Aesir | Thanks svick, I got caught up in reading about the binary search on wikipedia where it says you need an ordered list and didn't actually realise I could use it in this case without. I will implement your suggestions later and update, thanks. | |
| Jul 29, 2012 at 21:00 | history | edited | svick | CC BY-SA 3.0 |
added 414 characters in body
|
| Jul 29, 2012 at 20:52 | history | answered | svick | CC BY-SA 3.0 |