-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We are importing `forge-fmt` for two reasons: - This ensures that forge-fmt uses the latest solang-parser crate, and we only have one version of solang-parser in solang binary - This makes it possible to publish the solang crate to crates.io, since forge-fmt is not on crates.io and no git depdendencies are allowed - We requested feedback from Foundry on their discord server but received no feedback This feature is enabled with the help of [forge-fmt](https://github.com/foundry-rs/foundry/tree/master/crates/fmt). Cc: @gakonst @DaniPopes Signed-off-by: Govardhan G D <[email protected]>
- Loading branch information
Showing
5 changed files
with
179 additions
and
8 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
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
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
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
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,48 @@ | ||
contract deck { | ||
enum | ||
suit { | ||
club, | ||
diamonds, | ||
hearts, | ||
spades | ||
} | ||
enum value { | ||
two, | ||
|
||
|
||
three, | ||
four, | ||
five, | ||
six, | ||
seven, | ||
eight, | ||
nine, | ||
ten,jack, | ||
queen, | ||
king, | ||
ace | ||
} | ||
struct card { | ||
value v; | ||
suit s; | ||
} | ||
|
||
function score | ||
(card c) public returns ( | ||
uint32 score) { | ||
if (c.s == suit.hearts) { | ||
if (c.v == value.ace) { | ||
score = 14; | ||
} | ||
if ( c.v == value.king) { | ||
score = 13; | ||
} | ||
if ( c.v == value.queen) { | ||
score = 12; | ||
} | ||
if ( c.v == value.jack) { | ||
score = 11;} | ||
} | ||
// all others score 0 | ||
} | ||
} |