pp

Dependencies:   mbed

Game.cpp

Committer:
NamSom
Date:
2015-12-05
Revision:
1:ba7154d2d7ca
Child:
4:a61cdd4e7afa

File content as of revision 1:ba7154d2d7ca:

#include"Game.h"

const char hex[16] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
const bool bcd[16][4] = {{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1},{0,1,0,0},{0,1,0,1},{0,1,1,0},{0,1,1,1},
                         {1,0,0,0},{1,0,0,1},{1,0,1,0},{1,0,1,1},{1,1,0,0},{1,1,0,1},{1,1,1,0},{1,1,1,1}};

char Game::gethex(int dec)
{
    return hex[dec];
}
void Game::random()
{
    for(int i=0;i<n;i++)
    {
        //hexRandom[i] = random
    }
}
void Game::hextobcd()
{
    for(int i=0;i<n;i++)
    {
        mybcd[i][0] = bcd[hexRandom[i]][0];
        mybcd[i][1] = bcd[hexRandom[i]][1];
        mybcd[i][2] = bcd[hexRandom[i]][2];
        mybcd[i][3] = bcd[hexRandom[i]][3];
    }
}