Advertisement
Zung_the_great

Paint_pascal_25*80

Feb 13th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. program unknow;
  2. uses crt;
  3. type int = integer;
  4. var
  5. k : char;
  6. co : int;
  7.  
  8.  
  9. procedure movement(var i,j:int);
  10. var io,jo:int;
  11. begin
  12. k:=readkey;
  13.  
  14. case k of
  15.  
  16. 'M' : if(j<80) then begin
  17. textcolor(co);
  18. gotoxy(j,i); write('>');
  19. j:=j+1;
  20. textcolor(black);
  21. gotoxy(j,i); write('>');
  22. end;
  23. 'K' : if (j>1) then begin
  24.  
  25. textcolor(co);
  26. gotoxy(j,i); write('<');
  27. textcolor(black);
  28. j:=j-1;
  29. gotoxy(j,i); write('<');
  30. end;
  31. 'H' : if (i>1) then begin
  32. textcolor(co);
  33. gotoxy(j,i); write('^');
  34. i:=i-1;
  35. textcolor(black);
  36. gotoxy(j,i); write('^');
  37. end;
  38. 'P' : if (i<24) then begin
  39. textcolor(co);
  40. gotoxy(j,i); write('V');
  41. textcolor(black);
  42. i:=i+1;
  43. gotoxy(j,i); write('V');
  44. end;
  45. 'c' : begin
  46. inc(co);
  47. textcolor(co);
  48. textbackground(co);
  49. if co=8 then begin
  50. co:=1;
  51. textcolor(co+blink);
  52. textbackground(co+blink);
  53. end;
  54. end;
  55.  
  56. 'e' :begin
  57. co:=7;
  58. textcolor(co);
  59. textbackground(co);
  60. end;
  61.  
  62. 'a' :begin
  63. co:=0;
  64. repeat
  65. inc(co);
  66. textcolor(co);
  67. textbackground(co);
  68. for io:=1 to 25 do for jo:=1 to 80 do write('C');
  69. until co=7;
  70. textcolor(black);
  71. gotoxy(1,25); write('COLOR : ');
  72. end;
  73. end;
  74. end;
  75.  
  76.  
  77. procedure play;
  78. var i,j:int;
  79. begin
  80. textbackground(white);
  81. for i:=1 to 25 do for j:=1 to 80 do write('C');
  82.  
  83. textcolor(black);
  84. textbackground(white);
  85. gotoxy(1,1); write('Y'); i:=1; j:=i; co:=7;
  86. textcolor(black);
  87. gotoxy(1,25); write('COLOR : ');
  88. while k<>#27 do
  89. begin
  90. movement(i,j); textcolor(co);
  91. gotoxy(9,25); write('0 ',co);
  92. end;
  93. end;
  94.  
  95. procedure head;
  96. begin
  97.  
  98. end;
  99.  
  100. begin
  101. clrscr;
  102. play;
  103. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement