http://www.ticalc.org/archives/files/fileinfo/431/43167.html


the best project I evar had
Lay. Off. The. Shift+1. Combination.
meh I made this cause I was bored / I have no life
Don't call the topic title WFRNG.net unless you made a website called "wfrng.net". .Net or .NET are the proper titles of the Microsoft library/environment/IDE thing
yeah, I tihnk that came up in omni too >.<
qazz42 wrote:
yeah, I tihnk that came up in omni too >.<
Dammit, can anyone make a post on Cemetech anymore without mentioning rival sites at least three times per post? Razz

Good job on this, though, qazz; do you have any screenshots for our enjoyment?
:/ what? so now cemetech and... the other site are having a user contest?

sigh..

anyways
So... you're never right? Or do you not guess until you get it?
oh, thats when it was seeded at 45, it is random between 1-30 now Very Happy
What happens when you get it right? Does it behave just like the on-calc versions?
well, try it for your self, I cant go giving away spoilers Razz
Aww, didn't you give them away on Omnimaga though?
no, I dont tell anyone what happens >Very Happy it is an adventure they must take up themselves
But I don't run windows, and this being .Net kinda screws me over! Now I am offended and nikky.
D:

Noo! Oh well, suxs then :/

ok fine... a MessageBox.Show appears with nick's ticalc pass
CDI: You can always use Mono.
Well at least there's one small good thing about this clone: it's not 200 KB large like the other Windows WFRNG clone on ticalc.org. Razz
qazz42 wrote:
D:

Noo! Oh well, suxs then :/

ok fine... a MessageBox.Show appears with nick's ticalc pass
Fascinating that you didn't decide to just display it in the console window like the rest of the text; I guess you wanted to test out everything you've learned thus far? Smile
Nah, I just thought that the wonderful prize shouldnt be reduced to plain text, no, it gets the special treat of being in a MessageBox Smile
Good work!

You should only create a single Random instance and use that throughout your program (that is, move Random myRandom = new Random(); outside the for ( ;; ) loop). You'll end up with the same sequence of random numbers every time; a typical way to avoid this is to seed the random number generator with a different value each time the program runs (one easy way is to use a truncated form of the current date and time, new Random((int)DateTime.Now.Ticks)).

Of course, this doesn't matter if you're only using a single random value (and changing every time you guess) but it's useful if you're aiming for a decent distribution of random numbers.

Your code throws an unhandled exception if you don't enter a valid number (e.g. "goat"). Consider using int.TryParse() instead, which will return true if value could be parsed and false otherwise.


Code:
int guess;
do {
    Console.Write("A=? ");
} while (!int.TryParse(Console.ReadLine(), out guess));


I've never seen this pattern before:

Code:
if (condition) {
    // do something
} else ;

Where did you pick that up? Smile
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement