-4
私はJDOS、またはJacobのDOSと呼ばれる単純なDOSクローンを持っていますが、何が欠けているのでしょうか?何を追加する必要があります
試してみると、admin
という名前のコマンドはありません。パスワードは空白なので、単にEnterを押してください。
私はPythonの初心者プログラマーですので、難しくはありませんが、挑戦してください。ここで
はスクリプトです:def jdos1():
print " Boot JDOS.exe?"
answer = raw_input(" [y] or [n]").lower()
if answer == "y" or answer == "[y]":
import time
time.sleep(1)
print " Welcome to JDOS"
time.sleep(1)
print " Type cmds for a list of all avalible commands"
def jdos2():
cmd = raw_input().lower()
if cmd == "exit":
print " Exiting JDOS"
time.sleep(1)
elif cmd == "info":
print "JDOS Script 1.4.0. Created by Jacob Snyder [email protected]"
jdos2()
elif cmd == "ver":
print "JDOS 1.4.0"
jdos2()
elif cmd == "upd":
print ""
jdos2()
elif cmd =="admin":
password = raw_input(" Please enter your admin password.")
def admin():
if password == "".lower():
print " rebooting in admin mode"
time.sleep(1)
print " Welcome to JDOS-Admin"
def admin2():
cmd = raw_input().lower()
if cmd == "exit":
print " Exiting JDOS-Admin"
time.sleep(3)
elif cmd == "password":
print " Your password is, %s" % (password)
admin2()
elif cmd == "admin":
print " Already booted in admin mode"
admin2()
elif cmd == "format":
print " Formatting D:"
time.sleep(3)
elif cmd == "ver":
print " JDOS 1.4.0"
admin2()
elif cmd == "info":
print " JDOS-Admin Script 1.4.0. Created by Jacob Snyder [email protected]"
admin2()
elif cmd == "upd":
print ""
admin2()
elif cmd == "date":
from datetime import datetime
now = datetime.now()
print ' %s/%s/%s' % (now.month, now.day, now.year)
admin2()
elif cmd == "add":
inp1 = float(raw_input(" Enter 1st integer:"))
inp2 = float(raw_input(" Enter 2nd integer:"))
oup1 = inp1 + inp2
print " %s+%s=%s" % (inp1, inp2, oup1)
admin2()
elif cmd == "subtract":
inp1 = float(raw_input(" Enter 1st integer:"))
inp2 = float(raw_input(" Enter 2nd integer:"))
oup1 = inp1 - inp2
print " %s-%s=%s" % (inp1, inp2, oup1)
admin2()
elif cmd == "multiply":
inp1 = float(raw_input(" Enter 1st integer:"))
inp2 = float(raw_input(" Enter 2nd integer:"))
oup1 = inp1 * inp2
print " %sx%s=%s" % (inp1, inp2, oup1)
admin2()
elif cmd == "divide":
inp1 = float(raw_input(" Enter 1st integer:"))
inp2 = float(raw_input(" Enter 2nd integer:"))
oup1 = inp1/inp2
print " %s/%s=%s" % (inp1, inp2, oup1)
admin2()
elif cmd == "cmds" or cmd == "cmd":
print " cmds, date, add, subtract, multiply, divide, password, admin, format, ver, info, upd, exit"
admin2()
else:
print " Invalid command"
admin2()
admin2()
elif password == "cancel":
print " Canceling"
else:
print " Incorrect password"
admin()
elif cmd == "secret":
print " Congrats on finding the secret, Heres a cookie! . ____ ./- . \ |, - * | .\____/"
jdos2()
elif cmd == "date":
from datetime import datetime
now = datetime.now()
print ' %s/%s/%s' % (now.month, now.day, now.year)
jdos2()
elif cmd == "add":
inp1 = float(raw_input(" Enter 1st integer:"))
inp2 = float(raw_input(" Enter 2nd integer:"))
oup1 = inp1 + inp2
print "%s+%s=%s" % (inp1, inp2, oup1)
jdos2()
elif cmd == "subtract":
inp1 = float(raw_input(" Enter 1st integer:"))
inp2 = float(raw_input(" Enter 2nd integer:"))
oup1 = inp1 - inp2
print "%s-%s=%s" % (inp1, inp2, oup1)
jdos2()
elif cmd == "multiply":
inp1 = float(raw_input(" Enter 1st integer:"))
inp2 = float(raw_input(" Enter 2nd integer:"))
oup1 = inp1 * inp2
jdos2()
elif cmd == "divide":
inp1 = float(raw_input(" Enter 1st integer:"))
inp2 = float(raw_input(" Enter 2nd integer:"))
oup1 = inp1/inp2
print "%s/%s=%s" % (inp1, inp2, oup1)
jdos2()
elif cmd == "cmds" or cmd == "cmd":
print " cmds, date, add, subtract, multiply, divide, info, upd, ver, exit"
jdos2()
else:
print " Invalid command"
jdos2()
jdos2()
elif answer == "n":
print ""
else:
print " Invalid command"
jdos1()
jdos1()
を実装するために利用可能なコマンドの膨大なリストを取得します私たちにはたくさんのコードを読んでくれました。なぜあなたは何かが欠けていると思いますか?あなたはどんな行動を期待していますか? – jcolemang
私はプログラミングに関する質問ではないので、この質問を議論の対象外とすることに投票しました。 – smarx