haduhh,,,ternyata pas lagi belajar pascal ,,,echhh nemuin script ini nech di salah satu forum,, emang sich gamenya udah lama tapi gamenya seru juga loch,,,xixixixi,,,
dibawah ini adalah salah satu program Games sulap angka pascal yang bisa anda pakai di turbo pascal ,,,
silahkan Copy paste script dibawah ini !
PROGRAM SULAPANGKA;
USES CRT;
VAR I, J, K, L: INTEGER;
YT: CHAR;
NILAI:INTEGER;
FUNCTION CSTR(I: INTEGER): STRING;
VAR
S: STRING[11];
BEGIN
STR(I, S);
CSTR := S;
END;
PROCEDURE TULIS(POSISI:INTEGER; TEKS:STRING);
VAR A, B, C: INTEGER;
BEGIN
A := POSISI;
B := POSISI MOD 10;
C := 1;
IF B = 0 THEN
BEGIN B := 10;C := 0; END;
GOTOXY(B * 8 - 5,
(A DIV 10 + C) * 3 + 1);
WRITE(TEKS);
END;
(* Untuk symbol-symbol seperti : ÉÍÍ,
dapat Anda ganti dengan symbol: # atau lainnya *)
PROCEDURE BIKIN_KOTAK(KOLOM, BARIS: INTEGER);
BEGIN
CLRSCR;
FOR I:= 1 TO KOLOM DO
BEGIN
FOR J := 1 TO BARIS DO
BEGIN
GOTOXY (J * 8 - 7, (I * 3));
WRITE('ÉÍÍÍÍ»');
GOTOXY (J * 8 - 7, (I * 3 + 1));
WRITE('º º');
GOTOXY (J * 8 - 7, (I * 3 + 2));
WRITE('ÈÍÍÍͼ');
END;
END;
END;
PROCEDURE WIZARD7;
BEGIN
CLRSCR;
WRITELN('ANGKA YANG ANDA PILIH = ', NILAI);
WRITELN;
WRITE('INGIN MENGULANG (Y/ESC.)? ');READKEY;
YT := READKEY;
END;
PROCEDURE WIZARD6;
BEGIN
BIKIN_KOTAK(2, 10);
FOR I := 1 TO 19 DO
TULIS(I, CSTR(I + 31));
GOTOXY (5, 15);
WRITE('APAKAH ANGKA YANG ANDA PILIH',
' ADA PADA DERETAN ANGKA DI ATAS (Y/T) ');
REPEAT
YT := READKEY;
UNTIL YT IN ['y', 'Y', 't', 'T', #27];
IF UPCASE(YT) = 'Y' THEN
NILAI := NILAI + 32;
WIZARD7;
{===============================}
END;
PROCEDURE WIZARD5;
BEGIN
BIKIN_KOTAK(2, 10);
FOR I := 1 TO 16 DO
TULIS(I, CSTR(I + 15));
FOR J := 17 TO 19 DO
TULIS (J, CSTR(J + 31));
GOTOXY (5, 15);
WRITE('APAKAH ANGKA YANG ANDA PILIH',
' ADA PADA DERETAN ANGKA DI ATAS (Y/T) ');
REPEAT
YT := READKEY;
UNTIL YT IN ['y', 'Y', 't', 'T', #27];
{===============================}
IF UPCASE(YT) = 'Y' THEN
NILAI := NILAI + 16;
WIZARD6;
END;
PROCEDURE WIZARD4;
BEGIN
BIKIN_KOTAK(3, 10);
FOR J := 0 TO 2 DO
FOR I := 1 TO 8 DO
TULIS(J * 8 + I, CSTR(J * 16 + I + 7));
GOTOXY (5, 15);
WRITE('APAKAH ANGKA YANG ANDA PILIH',
' ADA PADA DERETAN ANGKA DI ATAS (Y/T) ');
REPEAT
YT := READKEY;
UNTIL YT IN ['y', 'Y', 't', 'T', #27];
IF UPCASE(YT) = 'Y' THEN
NILAI := NILAI + 8;
WIZARD5;
{===============================}
END;
PROCEDURE WIZARD3;
BEGIN
BIKIN_KOTAK(3, 10);
FOR J := 0 TO 5 DO
FOR I := 1 TO 4 DO
TULIS(J * 4 + I, CSTR(J * 8 + I + 3));
GOTOXY (5, 15);
WRITE('APAKAH ANGKA YANG ANDA PILIH',
' ADA PADA DERETAN ANGKA DI ATAS (Y/T) ');
REPEAT
YT := READKEY;
UNTIL YT IN ['y', 'Y', 't', 'T'];
IF UPCASE(YT) = 'Y' THEN
NILAI := NILAI + 4;
WIZARD4;
{===============================}
END;
PROCEDURE WIZARD2;
BEGIN
BIKIN_KOTAK(3, 10);
J:=0;
FOR J := 0 TO 12 DO
FOR I := 1 TO 2 DO
TULIS(J * 2 + I, CSTR(J * 4 + I + 1));
GOTOXY (5, 15);
WRITE('APAKAH ANGKA YANG ANDA PILIH',
' ADA PADA DERETAN ANGKA DI ATAS (Y/T) ');
REPEAT
YT := READKEY;
UNTIL YT IN ['y', 'Y', 't', 'T', #27];
IF UPCASE(YT) = 'Y' THEN
NILAI := NILAI + 2;
WIZARD3;
{===============================}
END;
PROCEDURE WIZARD1;
BEGIN
BIKIN_KOTAK(3, 10);
L:= 1;
REPEAT
TULIS ((L + 1) DIV 2,CSTR(L));
L:= L + 2;
UNTIL L > 50;
GOTOXY (5, 15);
WRITE('APAKAH ANGKA YANG ANDA PILIH',
' ADA PADA DERETAN ANGKA DI ATAS (Y/T) ');
REPEAT
YT := READKEY;
UNTIL YT IN ['y', 'Y', 't', 'T', #27];
IF UPCASE(YT) = 'Y' THEN
NILAI := 1;
WIZARD2;
{===============================}
END;
PROCEDURE TULIS_NOMOR;
BEGIN
BIKIN_KOTAK(5, 10);
FOR K:= 1 TO 50 DO
TULIS(K, CSTR(K));
GOTOXY(1, 20);
WRITE ('PILIH SEBUAH ANGKA, ',
'TEKAN: Y, KALO MAU TERUS! ');
WRITE ('TEKAN ESC UNTUK KELUAR ');
REPEAT
YT := READKEY;
IF UPCASE(YT) = 'Y' THEN
BEGIN
NILAI := 0;
WIZARD1;
END;
UNTIL YT IN ['y', 'Y', 't', 'T', #27];
{===============================}
END;
(* Program Utama *)
BEGIN
CLRSCR;
TEXTATTR := $1F;
REPEAT
TULIS_NOMOR;
UNTIL YT = #27;
END.
0 komentar:
Posting Komentar
PLEASE INSERT CRITIC AND SUGGESTIONS
BECAUSE, YOU SUGGESTED USEFUL FOR ME