Skip to content

Instantly share code, notes, and snippets.

@axurright
Created October 24, 2024 19:46
Show Gist options
  • Select an option

  • Save axurright/56113a3147ec8ace1777a0a95646e45d to your computer and use it in GitHub Desktop.

Select an option

Save axurright/56113a3147ec8ace1777a0a95646e45d to your computer and use it in GitHub Desktop.
A guess the word game in Dart
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