Home of TurboCNC, the best open-source CNC control around...

  You are here:
  Homepage -> Articles -> RISK processor
Latest release of TurboCNC is v4.01 build 050312
released March 13

RISK processor

  Hardware Software  
Articles HOME FAQ's
  Manuals User
Ordering Contact
  Sitemap Links  

Anyone who's played the old wargame RISK from Milton Bradley knows that an awful lot of dice rolling is involved to determine the outcomes of the battles.  This is particularly true if you have good players that know the value of stockpiling armies and sets.

  So this little gem is a simple project to automate that.  I used 16F84 PIC processor and some LED's and other parts from the local Radio Shack to build an automatic dice roller.  Here's what it looks like in action.  Three attackers vs two defenders:

Attacker rolls first, 6 - 4 - 5.  The second roll is shown below:

Now the defender rolls 1 - 5.  

6 - 5 - 4 beats 5 - 1.  The defender loses 2 armies.

  The interface was a bit of a challenge to make usable yet simple at the same time.  One momentary push button does it all.  Pressing it rolls the dice, and holding it enters a setup phase where the number of dice for each side can be adjusted.

  Randomization is handled by incrementing a counter every TMR0 interrupt while restricting its value to some number between 1 and 6.  When the button is pressed, the current value of the counter becomes the dice roll.  Thus, the time when the user presses the button is the random element.

  A piezoelectric buzzer is connected internally to give the user feedback and to make it "cool" by adding simple sound effects.  Have a look at the source code if you're curious (6k download).  The goal of this project was to get something fun and useful while learning PIC assembly programming.

  "Ok, now all of these new armies are in Siam.  Attacking..."




2001-2023 DAK Engineering.  

All rights reserved.

This page last updated on January 11, 2015 .