# Hopscotch Academy - Always accepting new students and teachers!

#62

Yeah. (The second one)

#63

Oh hey, I would actually suggest transferring to your group... I will ask @t1_hopscotch to please delete my @HAcademy group, so we can fully transfer over to yours.

#64

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!

#65

Rounding 101-
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:

#66

Only in the first post.

#67

I learned that in fifth or sixth. It's simple, but I almost never use it, so I keep forgetting it.

#69

#70

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???

#71

I might do something on modulo, but modulo is kinda easy-ish......

Should I make a tutorial on modulo?

#72

Sure!

#73

#74

And kids, make sure to drink your ovaltine(milk)!

#75

# Modulo

Modulo is the remainder of the quotient when dividing. For example, in 5/2, the remainder is 1. Modulo is represented like this:

5%2

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.

#76

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...

#77

It is one of the most useful operators. I use it for complex ish backgrounds and simpler versions of older things.

#78

I'm sorry for not being available for the last couple of days -- it's been hectic!
@laser_eyed_puppy you are accepted as a teacher!

#79

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

#80

Thanks, I guess I just didn't really realize the uses for those operators because
I almost never use them.

#81

@ExquisiteSoup sorry, the lesson is proving hard to teach because of you skill level in math. Would you like to learn something else?

#82

Yes I agree. Round is also useful in save/load system that Zachyswag and I both experimented with. Maybe others.