Question: Requirements ( Part 1 ) [ 6 0 % ] You need to write a small contract that provides the following functionalities and requirements: 1

Requirements (Part 1)[60%] You need to write a small contract that provides the following functionalities and requirements: 1. Two players can register for a card-based Jungle game. a. This should be done by sending 1 ethers when invoking the register function. b. Return the received ethers if registration fails. 2. After registration, they can input the TWO choices via inputMove function. The choices represent the first and second round move for the player. a. Available choices (from the highest rank to the lowest): Lion, Wolf, Cat, Rat b. Rule: i. Lion captures Wolf; ii. Wolf captures Cat; iii. Cat captures Rat; iv. Rat captures Lion c. The choices must be unique for a player, e.g.,(Lion, Lion) is not allowed. (use require to enforce it)3. winning() function: anyone can check the winner after the players provide their choice. a. Both player must have inputted their choices. b. The player having the highest win count is the winner; she/he gets all the bets (2 ethers) c. Return 1 ether to both players if draw (no. of wins equal) d. Reset the game

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!