Yeah. (The second one)
Oh okay! Sounds great! @ExquisiteSoup I will make a Tutorial for self Objects. It will come out by tomorrow! Thanks! In the mean time, do some of my other lessons! I think they would fit you perfectly!
Rounding is very useful IRL. But in Hopscotch, it's uses are limited to what you ca do with it. Very few projects have used round in calculating the outcome of a specific order of events.
What is rounding?
Rounding is taking a number or variable and changing it to the closest round value which will always be a multiple of a number. If the round value was the number one, every number you could make with the number one (adding/subtracting) could be rounded to. If the number I wanted to round was 2., It would round down to 2, because 2 Can Be made from 1. Depending on what size numbers you are dealing with, your round value should increase or decrease.
How do I use round?
Generally, you won't use round for say normal whole number, you would use it for something like rounding an x or y position.
Optional Homeworj:Make A Project that would include round to help a variable get to an easy number to count to.
Goode Example For A Project:
Only in the first post.
I learned that in fifth or sixth. It's simple, but I almost never use it, so I keep forgetting it.
Hopscotch Username: NeonPuppy413
How long you have been on hopscotch: August 2016
Your strengths on hopscotch: Pixel Art
How often you are on: Everyday
Anything else: Nope
@WynterDiamond can I please be a teacher???
I might do something on modulo, but modulo is kinda easy-ish......
Should I make a tutorial on modulo?
And kids, make sure to drink your ovaltine(milk)!
Modulo is the remainder of the quotient when dividing. For example, in 5/2, the remainder is 1. Modulo is represented like this:
The modulo would be 1, in this case. 5%3 would be 2, 5%4 would be 1, and so on.
Modulo can be used to increase a variable at a certain time or have only even or odd numbers. It can also be used to have an object do certain things when variable are at a particular range.
Let's make a game. In this game, the player will dodge obstacles. For every three obstacles the player bumps into, the score will go down. (I will include screenshots of this later)
This game can be somewhat like subway surfers. In the character's code, add in this:
When (self) bumps (train[this can be whatever you like])
increase variable (Number of times bumped) by 1
This is not the main score, but it is a factor for what the score may be. For the next code, we add in modulo.
When [(Number of times bumped) % 3] = 0
Increase variable (Score) by -1
So now, every 3 times the character bumps the train, the score will go down by 1. If you want to, you can make it that the player will lose a life every 3 times it bumps into something. You can increase the variable if you wish.
If needed, I shall provide screen shots later.
Or, you could do the game the easier way... yeah, I find module pretty useless when it comes to coding. I can only see uses for it in calculators and actual math. Also round can be pretty useless at sometimes but I have found ways to make it work in some circumstances...
It is one of the most useful operators. I use it for complex ish backgrounds and simpler versions of older things.
Modulo can be used too for clocks or colour calculations (e.g. you could do number % 360 for hue) (and wow I think round is pretty handy... e.g. for Snap to Grid) But I can see these might not be so general
Thanks, I guess I just didn't really realize the uses for those operators because
I almost never use them.
@ExquisiteSoup sorry, the lesson is proving hard to teach because of you skill level in math. Would you like to learn something else?
Yes I agree. Round is also useful in save/load system that Zachyswag and I both experimented with. Maybe others.