Fakultas Ilmu Komputer UI

Commit 5b8d8ce6 authored by Ahmad Dzikrul Fikri's avatar Ahmad Dzikrul Fikri
Browse files

Tugas Pemrograman 6 - Tahap 2 - 1806196806

parent b24d3ec4
import urllib.request
from random import randint
def cari_nilai(pilihan,kesulitan):
page = urllib.request.urlopen("https://baguspribadi99.github.io/difficulty/difficulty.html")
......@@ -35,20 +36,15 @@ while hp_student>0 or hp_kuliah>0 :
print("Sayang sekali anda telah dimakan oleh beratnya tugas kuliah!")
hp_kuliah=0
if hp_kuliah>0:
jawaban = True
while jawaban== True:
action = input("Masukkan action untuk kuliah!! :").lower()
if action == 'serang':
hp_student-= attack_kuliah
print("Deadline menghantui student, HP student berkurang sebanyak",attack_kuliah)
jawaban = False
elif action == 'bertahan':
hp_kuliah += attack_kuliah
print("Ada revisi, HP kuliah bertambah sebanyak",attack_kuliah)
jawaban = False
else:
print(action,"tidak termasuk kedalam pilihan.(serang atau bertahan")
jawaban == True
serangan = randint(0,1)
if serangan == 0:
hp_student-= attack_kuliah
print("Deadline menghantui student, HP student berkurang sebanyak",attack_kuliah)
elif serangan == 1:
hp_kuliah += attack_kuliah
print("Ada revisi, HP kuliah bertambah sebanyak",attack_kuliah)
else:
print(action,"tidak termasuk kedalam pilihan.(serang atau bertahan")
else:
print("Selamat anda telah mengalahkan tugas-tugas kuliah!")
hp_student=0
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment