This program will give you some numbers for you to play the Euro Millions game. It needs the USB / serial connection and a terminal application on the PC side. Tested on KL25Z Good Luck

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
lmsousa
Date:
Mon May 11 08:11:30 2015 +0000
Parent:
0:4ade2e491919
Commit message:
Bug Fix. No more zeros

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri May 08 12:14:32 2015 +0000
+++ b/main.cpp	Mon May 11 08:11:30 2015 +0000
@@ -26,7 +26,7 @@
         pc.printf("\r\n---------------------------------\r\n");
         pc.printf("Numeros: ");
         for (n=1; n<(guessN+1); n++) {
-            pc.printf("%i  ",rand()%totalN);
+            pc.printf("%i  ",1+rand()%totalN);
             rled=!rled;
             wait (1.2);
         }
@@ -34,7 +34,7 @@
         pc.printf("\r\n---------------------------------\r\n");
         pc.printf("Estrelas: ");
         for (n=1; n<(guessS+1); n++) {
-            pc.printf("%i  ",rand()%totalS);
+            pc.printf("%i  ",1+rand()%totalS);
             gled=!gled;
             wait (1.2);
         }