Posted 20 August 2013 - 07:07 PM
I've written a program to tell you how many stacks + extra you'll need of a certain number of items. It's a very simple code that will ask users "How many items?" then wait for an input and use that number. I was hoping to skip the step of asking a user, and just allow an input like "divide 100" to directly come up with an answer. Here's an exampe:
Here's my code (pastebin):
Here's my code (pastebin):
Spoiler
print("How many items do you need?")
numberInput = read()
stackNumber = math.floor(numberInput/64)
remainder = numberInput - (stackNumber*64)
solution = "You'll need " ..tostring(stackNumber).. " stack(s) and " ..tostring(remainder).. " extra."
term.write(solution)