back to our bubbling!
March 4, 2008 at 9:55 pm (Uncategorized)
Tags: C++
For some time I wasn’t blogging due to some “things” that was going on in my life. Primarily in school! Anyway, the autopoker can now deal the cards, and also is able to detect what you have in your hand ( or each player ) except straight, straight flush, and royal flush. In fact, just the straight one is left. That being finished, the other two ( straight flush && royal flush ) are done.
Now, I wanted to tell you about an interesting thing I learned ( and keep up here and post comments, I will be posting stuff I learn ). It’s a timer. Apparently it’s in “iostream” library or ctime I think. What it does, is that it delays the execution of next command for N seconds/microseconds/nanoseconds depending on you.
This is how you use it:
sleep( N );
where “N” is the number of seconds.
you can also use it this way:
usleep( uN ); //uN is the number of microseconds
nanosleep( nanoN ); //I’m not sure how to actually use this one, but seems to follow other ones. nanoN is the number of nanoseconds.
also, if you want to take the current time for randomization purposes you do:
time( 0 );
which is good for:
srand( time( 0 ) );
I think they are in “ctime” library or “cstdlib” ( cstdlib for randomizing and ctime for time() )