Example ZenCode scripting engine.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

guessing.zs 241B

1234567891011
  1. var correct = false;
  2. while !correct {
  3. val value = randomInt(10);
  4. val guess = readLine("Guess a number 0-9: ");
  5. if value == int.parse(guess) {
  6. println("You were right!");
  7. correct = true;
  8. } else {
  9. println("Nope, try again...");
  10. }
  11. }