Welcome to the Unsure app! This text is a tutorial that you can play with.

Every Unsure app document ("napkin") is a plain text file like this one. But when you write an assignment like the following, Unsure app will understand it.

budget = 500
// → 500

You can of course do simple math.

perPerson = budget / 4
// → 125

Try changing the number 4 above and see how the result is automatically updated.

But where the Unsure app really shines is with uncertain numbers. Let's say we have the budget above ($500 dollars, unless you've changed it), and we're planning a trip. We want to know how much money we'll have per person, but first we need to factor in lodging. Renting a cabin will cost somewhere between $100 and $150.

cabin = 100~150
// → 100~150

Any time you see two numbers with a tilde (~) between them, that's a range. We're unsure how much the cabin will cost, but we know it's going to be somewhere in this range.

Now we can compute the real budget per person:

perPerson = (budget - cabin) / 4
// → 90~100

Now we know that, at the worst, we have $90 per person, and at best, we have $100.

But wait, things can get even more complicated in real life. We might have 4 people, or might have 5!

people = 4~5

perPerson = (budget - cabin) / people
// → 75~95

You get the idea. This way, you can combine as many unsure variables as you want, and let the computer worry about all the possibilities.

If you're up to it, try calculating — in the blank space below — how much money you have per person per day if the trip takes 4 to 6 days. Just start a line that's an assignment, and hit enter at the end.

perDay = perPerson / ???
// → ERROR somewhere after "perPerson " on the line above


Click the buttons bellow to see more examples, or click on File 1 and start writing your own napkin.
        
Here are some examples to get you going:


### Home Improvement ###

You decide your apartment needs a new carpet. You live in an 800 square feet apartment, and about 70% to 80% of the floor is carpeted.

area = 800
carpeted = 70~80%

You quickly browse through an eshop with carpets and decide your carpet will probably cost something between $2.50 and $3.50 per square foot. You plan to hire professional for something like $1 to $3 per square foot.

materialCostPerFoot = 2.50~3.50
installationCostPerFoot = 1~3

So, the new carpet will cost:

cost = area * carpeted * (materialCostPerFoot + installationCostPerFoot)
// → 2,300~3,750

And that's the range of total price for this home improvement project.


### Business ###

You want to start selling lemonade on your street. How much money could that make?

Looking out the window, you estimate how many people will come by per day.

dailyFootfall = 100~300
// → 100~300

Then you estimate what percentage of them will actually stop and buy lemonade, and the number of cups they'll buy.

conversion = 2~5%
averagePurchase = 1~2

Now you can see how many cups you might expect to sell per day.

dailyCupsSold = dailyFootfall * conversion * averagePurchase
// → 4~20

Okay, so if you want to make $100 each day, how much would each cup have to cost?

price = 100 / dailyCupsSold
// → 5~25

Probably not a very good business idea, then.


### Wedding ###

TBA


### Science ###

        
This is your own napkin. Number 1. Changes to it will be saved on your computer.
        
This is your own napkin. Number 2. Changes to it will be saved on your computer.
        
This is your own napkin. Number 3. Changes to it will be saved on your computer.