A decentralized game on a smart contract.
-
Ethereum Blockchain SinglePlayer Game developed in Solidity
-
ENVIRONMENT: Remix VM
-
IDE: Remix - Ethereum IDE
-
LICENSE: MIT
-
GAME MODE: Player vs CPU
-
The player must be able to choose between EVEN or ODD
-
The player must be able to choose numbers from 0 to 2
-
After successfully making a move, the player should be able to view information such as: "Winner", "Choice Made", "Number played by the player", "Number played by the CPU"
-
Must use the minimum Solidity compilation version ^0.8.12
-
Should use Solidity's native concat function to manipulate strings
-
Should use the library @openzeppelin/contracts/utils/Strings.sol for string conversion
-
Should use the global 'block' variable to access block information
-
Should use abi.encodePacked for encoding
-
Should use Solidity's keccak256 hashing system
-
The game must start with no choice made
-
The player can only play a number if they have chosen EVEN or ODD beforehand
-
The player can only choose between EVEN or ODD, and the message "Choose EVEN or ODD" should be displayed if neither option is chosen
-
The player can only play numbers 0, 1, or 2, and the message "Play 0, 1, or 2" should be displayed if none of these options is chosen
-
The CPU's move should be generated with a random value, using the block.timestamp and the player's choice
-
Open the Remix IDE at the link: https://remix.ethereum.org/
-
Create a new file inside the 'contracts/' folder with the name 'EvenOrOdd.sol'
-
Copy the contents of the 'EvenOrOdd.sol' file from this project and paste it into the 'EvenOrOdd.sol' file you just created in Remix
-
Compile using the 'Solidity Compiler' option
-
Deploy using the 'Deploy & run transactions' option
-
Expand the deploy options, make your move, and good luck!!!
Project for applying concepts covered in Luiz Tools' Web23 course."