ALGORITMA GAME
{Algoritma untuk membuat tampilan game
tebakan}
Deklarasi
a = integer
Tebakan = integer
x = integer
Deskripsi
Begin
Read (x)
if (x == 0)
do
Writeln("
| | | | | | | |")
Writeln("
| | | | | | | |")
Writeln("
| | | | | | | |")
Writeln("
| | | | | | | |")
Writeln("
| | | | | | | |")
Writeln("
| | | | | | | |")
Writeln("
| | | | | | | |")
Writeln("
| | | | | | | |")
x++
while
(x<10000)
Writeln("Masukkan
Angka (1-10): ", tebakan)
if (a==tebakan)
Writeln("Selamat
anda MENANG!!")
Writeln(" ++++ ++++ ")
Writeln("+++ +++
+++ +++")
Writeln("+++++ +++ +++++")
Writeln("
+++++ +
+++++ ")
Writeln(" ++++ ++++ ")
Writeln(" +++ +++
")
Writeln(" ++
++ ")
Writeln(" ++ ++ ")
Writeln(" ++
++ ")
Writeln(" +++ ")
Writeln(" + ")
Writeln("
^ _ ^ Silahkan Mencoba Lagi ^ _ ^ ")
Writeln("Terima
Kasih sudah bermain game")
Else if (tebakan != a && tebakan
== 0||tebakan ==1 || tebakan
==2||tebakan==3||tebakan==4||tebakan==5||tebakan==6||tebakan
==7||tebakan==8||tebakan==9||tebakan==10)
Writeln("sorry
Anda kurang Beruntung!!! ")
Read(a)
a =
angka.nextInt(10-0) + 1
Writeln("Nomor
Keberuntungan anda adalah: ", a)
Writeln("_________ ________")
Writeln(" | |
")
Writeln(" | |
")
Writeln(" ________ ")
Writeln("
")
Writeln("
^ _ ^ Silahkan Mencoba Lagi ^ _ ^ ")
Else
Writeln("Angka
yang anda masukkan tidak sesuai")
Writeln("Baca
Petunjuk terlebih dahulu")
Writeln("Ingin mencobanya lagi ?")
Writeln("1 = iya")
Writeln("2 = tidak")
x = scn.nextInt()
do
Writeln("
| | | | | | | |")
Writeln("
| | | | | | | |")
Writeln("
| | | | | | | |")
Writeln("
| | | | | | | |")
Writeln("
| | | | | | | |")
Writeln("
| | | | | | | |")
Writeln("
| | | | | | | |")
Writeln("
| | | | | | | |")
x++
while
(x<10000)
Writeln("Masukkan
Angka (1-10): ", tebakan)
if (a==tebakan)
Writeln("Selamat
anda MENANG!!")
Writeln(" ++++ ++++ ")
Writeln("+++ +++
+++ +++")
Writeln("+++++ +++ +++++")
Writeln("
+++++ +
+++++ ")
Writeln(" ++++ ++++ ")
Writeln(" +++ +++
")
Writeln(" ++
++ ")
Writeln(" ++ ++ ")
Writeln(" ++
++ ")
Writeln(" +++ ")
Writeln(" + ")
Writeln("
^ _ ^ Silahkan Mencoba Lagi ^ _ ^ ")
Writeln("Terima
Kasih sudah bermain game")
Else if (tebakan != a && tebakan
== 0||tebakan ==1 || tebakan
==2||tebakan==3||tebakan==4||tebakan==5||tebakan==6||tebakan
==7||tebakan==8||tebakan==9||tebakan==10)
Writeln("sorry
Anda kurang Beruntung!!! ")
Read(a)
a =
angka.nextInt(10-0) + 1
Writeln("Nomor
Keberuntungan anda adalah: ", a)
Writeln("_________ ________")
Writeln(" | |
")
Writeln(" | |
")
Writeln(" ________ ")
Writeln("
")
Writeln("
^ _ ^ Silahkan Mencoba Lagi ^ _ ^ ")
Else
Writeln("Angka
yang anda masukkan tidak sesuai")
Writeln("Baca
Petunjuk terlebih dahulu")
While (x==1)
if( x == 2)
Writeln("Terima Kasih Telah Berkunjung “)
Writeln("Ingin mencobanya lagi ?")
Writeln("1 = iya")
Writeln("2 = tidak")
x = scn.nextInt()
Endif
End
No comments:
Post a Comment