hpfdf hpfdf
关注数: 11 粉丝数: 15 发帖数: 1,663 关注贴吧数: 11
华容道互动程序 FreePascal Program ex;// By HPF// 2008.10.26Uses crt;Var i, j, x, y, k: longint; a: array [1..10] of record x, y: byte; end; b: array [0..6, 0..5] of boolean; finished: boolean;Procedure printform;begin gotoxy(3, 2); textcolor(white); write(#201); for i:=1 to 40 do write(#205); write(#187); for i:=1 to 35 do begin gotoxy(3, 2 + i); write(#186, '':40, #186); end; cursoroff; gotoxy(3, 38); write(#200); for i:=1 to 9 do write(#205); write(#181); write('':20); write(#198); for i:=1 to 9 do write(#205); write(#188); gotoxy(55, 10); writeln('Hua Rong Dao'); gotoxy(50, 16); textcolor(lightgray); writeln('Press "0".."9" to choose'); gotoxy(52, 18); writeln('Press "'#24#25#26#27'" to move');end;Procedure initgame;begin a[1].x := 1; a[1].y := 2; {1--2x2} a[2].x := 3; a[2].y := 2; {2--1x2} a[3].x := 1; a[3].y := 1; {3--2x1} a[4].x := 3; a[4].y := 1; {4--2x1} a[5].x := 1; a[5].y := 4; {5--2x1} a[6].x := 3; a[6].y := 4; {6--2x1} a[7].x := 5; a[7].y := 1; {7--1x1} a[8].x := 5; a[8].y := 2; {8--1x1} a[9].x := 5; a[9].y := 3; {9--1x1} a[10].x := 5; a[10].y := 4; {10-1x1} fillchar(b, sizeof(b), false); b[4, 2] := true; b[4, 3] := true;end;Procedure draw(v: byte);begin textbackground(black); window(4, 3, 44, 37); if (v = 255) or (v = 1) or (y = 1) then begin textbackground(black); gotoxy(a[1].y * 10 - 9, a[1].x * 7 - 6); if x = 1 then textcolor(brown) else textcolor(lightgray); write(' '#220#220#220#220#220#220#220#220#220#220#220#220#220#220#220#220#220#220' '); gotoxy(a[1].y * 10 - 9, a[1].x * 7 - 5); write(#222#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#221); gotoxy(a[1].y * 10 - 9, a[1].x * 7 - 4); write(#222#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#221); gotoxy(a[1].y * 10 - 9, a[1].x * 7 - 3); write(#222#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#221); gotoxy(a[1].y * 10 - 9, a[1].x * 7 - 2); write(#222#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#221); gotoxy(a[1].y * 10 - 9, a[1].x * 7 - 1); write(#222#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#221); gotoxy(a[1].y * 10 - 9, a[1].x * 7 - 0); write(#222#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#221); gotoxy(a[1].y * 10 - 9, a[1].x * 7 + 1); write(#222#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#221); gotoxy(a[1].y * 10 - 9, a[1].x * 7 + 2); write(#222#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#221); gotoxy(a[1].y * 10 - 9, a[1].x * 7 + 3); write(#222#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#221); gotoxy(a[1].y * 10 - 9, a[1].x * 7 + 4); write(#222#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#219#221);
1 下一页