-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b432e17
commit fb77267
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//SPDX-License-Identifier: GPL-3.0 | ||
|
||
pragma solidity >=0.5.0 <0.9.0; | ||
|
||
contract Day5 { | ||
//Create an array(address type) which stores only 16 elements | ||
address[16] team; | ||
//getTeamPlayers() - To return the entire array elements. | ||
function getTeamPlayers() public view returns (address[16] memory) { | ||
return team; | ||
} | ||
//selectJerseyNumber() - It will take only one argument of uint type and returns the players address from the array created above. a) The argument passed into the function must be greater than equal to zero and less than equal to 15. | ||
function selectJerseyNumber(uint256 playerId) public returns (uint256) { | ||
require(playerId >= 0 && playerId <= 15); | ||
team[playerId] = msg.sender; | ||
return playerId; | ||
} | ||
} |