daily pastebin goal
34%
SHARE
TWEET

Untitled

a guest May 17th, 2018 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program snake;
  2. uses Crt;
  3. var
  4.   HeadX,HeadY,BodyX,BodyY,TailX,TailY:byte;
  5.   Wiggle:String;
  6.  
  7. procedure Board;
  8. var X,Y:byte;
  9. begin
  10.   For Y:=1 to 9 do
  11.    begin
  12.    For X:=1 to 9 do
  13.     begin
  14.      if (((HeadX=X) and (HeadY=Y)) or ((BodyX=X) and (BodyY=Y)) or ((TailX=X) and (TailY=Y))) then
  15.        TextColor(Green) else TextColor(White);
  16.      Write('# ');
  17.     end;
  18.    WriteLn;
  19.    end;
  20. end;
  21.  
  22. begin
  23.  TailX:=4; TailY:=5;
  24.  BodyX:=5; BodyY:=5;
  25.  HeadX:=6; HeadY:=5;
  26.  Board;
  27.  
  28.  Write('Where shall I wiggle? '); ReadLn(Wiggle);
  29.  ReadLn;
  30.  
  31.  
  32. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top