⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 number.txt

📁 一个编译器源代码。用法看里面的“使用说明”
💻 TXT
字号:
Program(Guess,Dos.MZ);
  Var(Answer,Byte);
  Var(Num,Byte,4);
  Var(X,Byte);
  Var(Lives,Byte,4);
  Var(Life,Byte,3);
  Const(Line,'哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪');

  Function WriteLives():Byte;
    Screen.Clear;
    X = 0;
    Cursor.Set(1,2);
    Color.Set(Color.Red);
    WriteLife:
      Write(Life);
      X =+ 1;
      if X < Lives goto WriteLife;
    Write(Line+Line,Color.White,2,0);
  Return;
Begin
  if Lives = 0 goto GameOver;
  WriteLives;
  Write('Guess a number between 0 and 9: ',Color.Yellow,12,18);
  Answer = Read() - $30;
  Lives =- 1;
  IfNot Answer in [0..9] Goto Error;

  If Answer < Num Goto HigherNum;
  If Answer > Num Goto LowerNum;
  If Answer = Num Goto Correct;

  HigherNum:
    WriteLives;
    Write('That was a nice guess,',Color.Yellow,12,18);
    Write('but the number is too low!',Color.Red,13,18);
    Wait;
    Jump(Start);

  LowerNum:
    WriteLives;
    Write('That was a nice guess,',Color.Yellow,12,18);
    Write('but the number is too high!',Color.Red,13,18);
    Wait;
    Jump(Start);

  Error:
    WriteLives;
    Write('You didn'+Quote.Single+'t write a number!!',Color.Red,12,18);
    Wait;
    Jump(Start);

  GameOver:
    WriteLives;
    Cursor.Set(1,2);
    Color.Set(Color.Red,12);
    Write('Game Over!!!');
    Wait;
    End;

  Correct:
    WriteLives;
    Cursor.Set(12,18);
    Color.Set(Color.Lime,40);
    Num =+ $30;
    Write('Correct answer!!! '+Num+' is the right number!');
    Cursor.Set(13,18);
    Color.Set(Color.Lime,40);
    Lives =+ $30;
    Write('Lives left: '+Lives);
    Wait;
End;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -