Lab4
Dependencies: mbed 4DGL-uLCD-SE PinDetect
farkle_assistant.h
00001 #include "mbed.h" 00002 #include "uLCD_4DGL.h" 00003 #include "MMA8452.h" 00004 #include "Speaker.h" 00005 #include "PinDetect.h" 00006 00007 #ifndef FARKLE_ASSISTANT_H 00008 #define FARKLE_ASSISTANT_H 00009 00010 00011 class Dice { 00012 private: 00013 int value; 00014 int x1, x2, y1, y2; 00015 00016 public: 00017 Dice(){} 00018 00019 Dice(int val) 00020 : value(val) {} 00021 00022 int getValue(){return value;} 00023 00024 void setValue(int val){value = val;} 00025 00026 void displayDice(int position); 00027 }; 00028 00029 class FarkleGame { 00030 private: 00031 Dice arrayDice[6]; 00032 int values[6]; 00033 int count[6]; 00034 int rollScore; 00035 int totalScore; 00036 int numDie; 00037 int sub; 00038 double x, y, z; 00039 int oneC, twoC, threeC, fourC, fiveC, sixC; 00040 public: 00041 FarkleGame(){} 00042 void setNumDie(int num){numDie = num;} 00043 00044 void setTotalScore(int tot){totalScore = tot;} 00045 00046 void runFarkle(); 00047 00048 void rollDice(); 00049 00050 void calcRoll(); 00051 00052 void displayScore(); 00053 00054 void takeAway(); 00055 }; 00056 00057 #endif
Generated on Wed Oct 26 2022 11:06:16 by
1.7.2