Squornshellous Beta
Active member
- Pronoun
- she/they/any
So. This is a project I'm working on, and my googling has turned up no useful results. So I'm hoping someone can help out.
Firstly, I would want to declare a variable.
That variable would take its initial value from a text input.
If a checkbox was checked, it would multiply the variable by 1.25, but otherwise leave it as it was.
Then it would divide the variable by 10, truncating it after the decimal point. I guess I would use math.Floor?
Then it would modify the variable based on the selected value of a select list, with the first option subtracting 1, the second leaving it the same, the third adding 1.
It would then check if the value of another text input, when divided by ten and math.floored, would be above 7. If it would be, it would add 7 to the variable; otherwise it would add the value divided by ten and math.floored.
If the value of the variable was less than 1, it would set it to 1. If it had a decimal, it would math.floor it. Otherwise, it would leave it as it were.
And finally, it would output the value, in text form, to a paragraph.
Whoo, that's kind of a lot when it's all listed like that :B I hope someone has the time to help me, haha. Preferably in the teachiest way possible, since I would quite like to add this to my limited JavaScript knowledge.
Firstly, I would want to declare a variable.
That variable would take its initial value from a text input.
If a checkbox was checked, it would multiply the variable by 1.25, but otherwise leave it as it was.
Then it would divide the variable by 10, truncating it after the decimal point. I guess I would use math.Floor?
Then it would modify the variable based on the selected value of a select list, with the first option subtracting 1, the second leaving it the same, the third adding 1.
It would then check if the value of another text input, when divided by ten and math.floored, would be above 7. If it would be, it would add 7 to the variable; otherwise it would add the value divided by ten and math.floored.
If the value of the variable was less than 1, it would set it to 1. If it had a decimal, it would math.floor it. Otherwise, it would leave it as it were.
And finally, it would output the value, in text form, to a paragraph.
Whoo, that's kind of a lot when it's all listed like that :B I hope someone has the time to help me, haha. Preferably in the teachiest way possible, since I would quite like to add this to my limited JavaScript knowledge.