Created
October 24, 2024 19:46
-
-
Save axurright/56113a3147ec8ace1777a0a95646e45d to your computer and use it in GitHub Desktop.
A guess the word game in Dart
This file contains hidden or 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
| import 'dart:io'; | |
| void main() { | |
| var word = "Random"; | |
| print("Guess the word!"); | |
| String? userGuess = stdin.readLineSync(); | |
| if (userGuess != null) { | |
| if (userGuess == word) { | |
| print("Congrats, the word was Random!"); | |
| } else if (userGuess != word) { | |
| print("Sorry, wrong word."); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment