Make sure you have npm and node installed globally on your machine.
> npm -v
6.1.0
> node -v
v8.9.4
Then run
> npm istall
Then compile the contract for testing by running
> node compile.js
To run tests:
> npm test
see spreadsheet
work on my local jvm ethereum network
- write function shuffleDeck(): it will randomly shuffle uint8[52]
- write function getDeck() public
work on my local jvm ethereum network
- write function computeCardValue() returns uint8
- write function computeHandValue() returns uint8
work on my local jvm ethereum network
- write function dealerDecision() returns bytes2
- decision is Hit or Stand
work on my local jvm ethereum network
- write function initPlayerHand()
- write function initDealerHand()
- write function giveTwoCardsToDealer()
- write function giveTwoCardsToPlayer()
100 will be the magic number to tell that the card has been removed from the deck. 200 will be the magic number to tell that the card in player hand is not defined
work on my local jvm ethereum network
- write function getPlayerHand()
- write function getDealerVisibleCard()
work on my local jvm ethereum network
- write function nextState()
-
on contract init, shuffle cards
-
merge all the logic together
- add testing suite (did this mostly because I wanted the practice)