Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed 4DGL-uLCD-SE PinDetect
FarkleGame.h
00001 #ifndef FARKLEGAME_H 00002 #define FARKLEGAME_H 00003 00004 #include "Die.h" 00005 #include "MMA8452.h" 00006 00007 #include <iostream> 00008 #include <string> 00009 00010 using namespace std; 00011 00012 class FarkleGame{ 00013 public: 00014 //Constructor 00015 FarkleGame(); 00016 00017 //Methods 00018 void dispIntro(uLCD_4DGL&, int); 00019 void init(); 00020 00021 //rolling/scoring methods 00022 void rollDice(); 00023 void displayDice(uLCD_4DGL&, int); 00024 void loadVals(int); 00025 int calcScore(); 00026 void updateScores(); 00027 00028 //display methods 00029 void dispFarkle(uLCD_4DGL&); 00030 void dispScore(uLCD_4DGL&); 00031 void dispTurn(uLCD_4DGL&); 00032 void scrnWipe(uLCD_4DGL&); 00033 00034 //acc methods 00035 bool checkRoll(MMA8452&); 00036 00037 //S&G 00038 int getDieVal(int); 00039 void setDieVal(int, int); 00040 00041 private: 00042 Die Dice[6]; 00043 int DiceVals[6]; 00044 00045 int turnScore; 00046 int rollScore; 00047 int farkles; 00048 }; 00049 00050 #endif
Generated on Wed Jul 13 2022 16:07:46 by
1.7.2