The other day I had a Risk and Settlers of Catan party. While both games are enjoyable the end game in Risk becomes rather tedious with two large armies battling against each other. Some may find the repetitive rolling enjoyable but most don't. Being that it was a party I had the laptop out so I wrote some scribbles and created a program geared towards Risk dice rolling (one battle at a time). By some coincidence Slashdot had an article about an online service that provides true random numbers...the "Quantum Random Bit Generator Service". Hmm...I guess I should link the two together.
So I did, you can find the very basic source (to compile with g++) here: risk_roll.cpp or the zip including the QRBG files here: risk_roll.zip.
Some would say that I may have over-designed but the flow of the program is quite linear and easy to read. It's also now easy to run stats with true random numbers and I'll run some when I get the time and post the results.
Smooth, very very smooth.
"Work It Out" by RJD2; the gentleman in the video is Bill Shannon.
A more complete version that might be the actual video, not sure...but it's good too.
Next dance party I can guarantee you that I'm doing this:
Oh, check out Slagsmålsklubben (6 Swedish Guys with Synths) while you're there.
Once again, been super busy but...
- Moved in! Been living here (sleeping, eating, gaming) for one week now. Fun times!
- Playing a lot of Risk since there isn't at TV. Next Risk game is probably going to involve Eric, Geoff, and Lenny (you're going down Lenny).
- Weather is good.
- Work is hectic.
- Chad has been working like mad on new things (expect things).
- Bills arrive fast and organization now is key.
- Network is up and running, going through the walls sometime during the week.
- Algorithm optimization...it's minor and overall the problem is NP (I believe) so it doesn't do anything overall but it does help some cases...still, it adds cost...so it's not worth it...think people THINK! I will be happy to continue discussions and shouting matches about your "new fangled way to find prime numbers".
I was watching this maze page solve itself (press the solve button) when optimization came to mind. You see, this maze solver seems to be brute forcing a solution by always turning left (initially) until the last turn results in a dead end. It then backs up to the last turn and tries the next turn in the sequence (left, straight, right). The technique mentioned is pretty good for mazes and there seems to be nothing one can do to speed it up but there are a few cases that one can do to aid in selecting what turn to make.
For instance, if one knows what direction they're heading in (known), start and end points (known), and the height and width of the maze (known) then a quick and easy optimization is to determine if one has reached the top of the maze and also if one has reached the bottom (or has one reached left and has one reached right). By knowing if you have reached the top and bottom in the same traversal then one knows that any bottom turns must be towards the exit. No solution will exist where you must backtrack all the way back past the top point and then turn right (you've cut off a portion of the maze). In essense you are starting a new maze with the top point the new start (yes you may be able to move left slightly up to the bottom most touch point but not past it). The same goes for left and right boundaries with reference to upwards and downwards movement.
This is a very small optimization but it can save a tremendous amount of time chasing a dead end. Basically, if you reach the bottom of the map and you are in a path that has reached the top don't take a turn away from the goal. If no turn towards the goal exists at the bottom then backtrack to the last turn that allows a turn towards the goal (end point).
Such small benefits are what keep programmers up all night.
I tested the interweb connection earlier today at the new place and it's connected. The computers shall make their move now.
Sigh...
goldeneye:/# uptime
14:09:55 up 405 days, 11:59, 1 user, load average: 1.37, 0.43, 0.15
I didn't realize how many games I had until I started moving...it's nowhere near as large as Omar's collection but it's large nonetheless.
In other news, I may have a very "neat" phone number for my land line. More details as to its neatness once I confirm that I have it.
It would be a good idea to get to bed early so that you can wake up nice and relaxed for the good day but...oh...let me just implement this one feature...
...oh...while I'm at it I may as well pass forward the linking error messages...
...oh...let's just test it...
...oh...to test this fully I could just manipulate the database or I could just implement this small other feature...
...oh...there's a lot of dead code in here...let's just clean it up...
...oh...there's a feature change I need to add so let's write it up...
...oh...it's 4 am.