Login
Remember
IF Answers
Ask a Question

# How to deal with large numbers in Squiffy?

–2 votes
73 views
asked Apr 12 in Authoring by Natas (17 points)
retagged Apr 12 by Alex

The follow code did not work.

    function addPoints(addNum,addOn) {
        if (addOn = selfHP)
            return selfLus + addNum
        else:
            return null

I am trying to use some outside of @dec selfHP five times. I tried to create a function however nothing at all happened. Do anyone know how to make something like this work?

- squiffy

commented Apr 12 by Alex (486 points)
This question is unclear. What are you trying to do?
commented Apr 12 by Natas (17 points)
Instead of having to do.
@inc someVar
@inc someVar
@inc someVar
To increase someVar by three, I am looking for a way that will take one line of code. Imagine if I was trying to do this in javascript.
var someVar =+3

## 1 Answer

+1 vote
answered Apr 12 by Alex (486 points)
selected Apr 12 by Natas
Best answer

Use this JavaScript to increase an attribute called "valiue" by 10:

    set ("value", get("value") + 10);

Live example: http://docs.textadventures.co.uk/squiffy/scratchpad/?gistid=8d1bb347653333e5daa4&filename=number.squiffy

## Related questions

- How to compare two variables in Squiffy?
- How to add a random number generator in Squiffy?
- Can I add dud links and tooltips in Squiffy with Javascript?
- Squiffy: How to force two variables to equal based off another variable?
- Squiffy: How to fix if else error?

...