#変数
question_char = 0
answers_list = []
#リスト
situmon_list = []
situmon_list.append("あなたはゲーム好きですか?")
situmon_list.append("あなたは将来人の役に立ちたいですか?")
situmon_list.append("あなたはスポーツ好きですか?")
def run_game():
global question_char
if len(situmon_list) == 0:
display("終了!",target="kouho_text",append=False)
display("あなたに似合っている職業は",target="button",append=False)
btn2 = js.document.getElementById("button2")
btn2.disabled="disabled"
btn3 = js.document.getElementById("button3")
btn3.disabled="disabled"
run_job()
return
question_char = situmon_list[0]
display(question_char,target="kouho_text",append=False )
#画像
kekka1 = "job_pro_gamer.png"
kekka2 = "kaden_tenin01_man.png"
kekka3 = "computer_programming_man.png"
kekka4 = "job_senesi.png"
kekka5 = "police_patocar_man.png"
kekka6 = "sports_baseball_man_asia.png"
kekka7 = "youtuber_virtual.png"
kekka8 = "banzai_businessman2.png"
def run_job():
if answers_list[0] == 1:
if answers_list[1] == 0:
if answers_list[2] == 0:
display("ゲーマー",target="situmon1_board",append=False)
js.document.getElementById("kekka").src = kekka1;
if answers_list[0] == 1:
if answers_list[1] == 1:
if answers_list[2] == 0:
display("プログラマー",target="situmon1_board",append=False)
js.document.getElementById("kekka").src = kekka3;
if answers_list[0] == 1:
if answers_list[1] == 1:
if answers_list[2] == 1:
display("Youtuber",target="situmon1_board",append=False)
js.document.getElementById("kekka").src = kekka7;
if answers_list[0] == 1:
if answers_list[1] == 0:
if answers_list[2] == 1:
display("ショップオーナー",target="situmon1_board",append=False)
js.document.getElementById("kekka").src = kekka2;
if answers_list[0] == 0:
if answers_list[1] == 0:
if answers_list[2] == 1:
display("スポーツ選手",target="situmon1_board",append=False)
js.document.getElementById("kekka").src = kekka6;
if answers_list[0] == 0:
if answers_list[1] == 1:
if answers_list[2] == 1:
display("警察官",target="situmon1_board",append=False)
js.document.getElementById("kekka").src = kekka5;
if answers_list[0] == 0:
if answers_list[1] == 0:
if answers_list[2] == 0:
display("会社員",target="situmon1_board",append=False)
js.document.getElementById("kekka").src = kekka8;
if answers_list[0] == 0:
if answers_list[1] == 1:
if answers_list[2] == 0:
display("教師",target="situmon1_board",append=False)
js.document.getElementById("kekka").src = kekka4;
#ボタン
def start():
display("質問に答えてください", target="button", append=False)
text = js.document.getElementById("button")
text.disabled=True
btn2 = js.document.getElementById("button2")
btn2.disabled=False
btn3 = js.document.getElementById("button3")
btn3.disabled=False
run_game()
def yes():
answers_list.append(1)
print(answers_list)
situmon_list.remove(question_char)
run_game()
def no():
answers_list.append(0)
print(answers_list)
situmon_list.remove(question_char)
run_game()
btn2 = js.document.getElementById("button2")
btn2.disabled="disabled"
btn3 = js.document.getElementById("button3")
btn3.disabled="disabled"
display("待機中",target="situmon1_board",append=False)