Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local width,height = 15,40
- local gradient = height/width
- local heightIntercept = -(gradient*width) + height
- for w=1,width do
- local output = ""
- for h=1,height do
- equation = gradient*w + heightIntercept
- if equation%1 < 0.5 then
- equation = math.floor(equation)
- else
- equation = math.ceil(equation)
- end
- if w == 1 or h == 1 or w == width or h == height then
- output = output .. " "
- elseif h == equation then
- output = output .. "x"
- else
- output = output .. " "
- end
- end
- print(output)
- end
Advertisement
Add Comment
Please, Sign In to add comment