This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
spawnslilhope's profile picture

New to this, strings not working

Started by spawnslilhope, 03 December 2012 - 08:39 AM
spawnslilhope #1
Posted 03 December 2012 - 09:39 AM
My code is as fallows (excuse the mess, i write inside the computer on minecraft)

–This is to build a tower

local floors = ""
local height = ""
local width = ""

–Have the user enter the height width and # of floors

term.clear()
term.write("How high would you like it?")
floors = read()
os.sleep(.1)
term.write("How wide would you like it?")
width = read()
os.sleep(.1)
print("So you want it .."height high and .."width wide?")




It runs until you enter two values, then returns a string error on the print() line.. Any help would be great, and sorry if this is a noob question.. I'm entirely new to any kind of programming.
Kingdaro #2
Posted 03 December 2012 - 10:03 AM
Yeah, your strings are a little funky on the last line.

print("So you want it "..height.." high and "..width.." wide?")
This should do it.