Week 15

Source Code

local myName = ""
print("Name: " .. myName)

-- Example 1


-- Example 2 


-- Example 3


-- Example 4


-- Example 5

w15problem1.lua

print("Problem 1")

w15problem2.lua

print("Problem 2")

w15problem3.lua

print("Problem 3")

w15problem4.lua

print("Problem 4")

w15problem5.lua

print("Problem 5")

w15problem6.lua

print("Problem 6")

w14problem7.lua

print("Problem 7")

w15problem8.lua

print("Problem 5")

w15problem9.lua

print("Problem 6")

w15problem10.lua

print("Problem 7")

project1.lua

print("Name: ") -- add your name here
print("Project 1")
print("Title: Jungle Run")
local points = 0 -- initial number of points in the game.

print("Your plane has crashed and when you exit, you find yourself in a humid jungle,")
print("unsure if there are other people around.")
print()
print("Do you re-enter the plane or seek shelter elsewhere? [re-enter/seek shelter]")
io.write("> ") -- unlike print, this does not add a new line
local choice=io.read()
if choice == "re-enter" then
    print("you chose to re-enter")
elseif choice == "seek shelter" then
    print("you chose to seek shelter")
else
    print("invalid choice")
end

Last updated