4-rooms/4rooms.jl
2017-09-29 17:25:10 -07:00

80 lines
1.9 KiB
Julia

include("story.jl")
function printc(color, message::AbstractString="", x...)
print_with_color(color, message)
end
function input(prompt::AbstractString="")
print(prompt)
return chomp(readline())
end
function title()
printc(:light_cyan, " ----------------------------------\n")
printc(:light_cyan, "| 4 Rooms |\n")
printc(:light_cyan, " ----------------------------------\n")
printc(:green, "By: Mollusk and CrabApple\n\n")
end
function start()
start = input("Press S to start.\n")
if start == "s"
return
end
end
function instructions()
print("Instructions: You will ecounter 4 rooms, starting with room 1. Each room will \n
contain items for you to choose from. Once you choose an item, it will interact in some way \n
with the items in the next room, or with the room itself. Choose wisely! Your decision impacts \n
your next set of choices. You have 3 tries per room, otherwise you fail the task.\n\n
You may press q to Quit the game at any time.\n\n")
Continue()
end
function Continue()
Continue = input("Press enter to continue...\n")
if Continue == ""
return
end
end
function room2()
print("You have reached ROOM 2.\n")
end
function room1()
print("ROOM 1\n\n")
print("You must choose one of 4 options to move to the next room.\n\n")
print("1. Get a lockpick.\n")
print("2. Get a bottle of water.\n")
print("3. Get cookies.\n")
print("4. Get a grenade.\n\n")
choice = input("Make your choice: ")
if choice == "1"
print("Here are your cookies! You may now move to the next room.\n\n")
Continue()
room2()
elseif choice == "2"
print("")
elseif choice == "3"
print("")
elseif choice == "4"
print("")
elseif choice == "q"
quit()
else
print("You did not select one of the given choices. Please begin again.")
end
end
title()
instructions()
room1()