I already explained += with my age example on the first page so take a look at that post to find the answer.
>= greater than or equal to
if age >= 21
Siletrea.drinks_beer
else
Siletrea.gets_arrested_for_being_a_minor
end
modulo... well, it's a leftover, really, that's all the mystery behind it.
7 % 4 = 3
Why 3? Well, 3 doesn't fit in 4 so we still got 3 guys that couldn't enter in a cabinet to make a phone call to Shanghai while the other 4 are calling people in Minnesota, Hawaii, Guatemala and Turkey.
You may wonder why most classes define a specific method namely initialize
class AOne
def initialize
@teacher = 'Siletrea'
@students = []
@scores = {}
end
end
Well, it tells Ruby, not RGSS, that you need to make a new copy of Class A so every year you can accept new pupils in your AOne class (meaning A-1). You were hired to teach them how to bake stuff in an oven.
In 2016 you did this
@my_class = AOne.new
This year you repeated the same process.
@my_class = AOne.new
Why it isn't called new?
It's complicated, it's Ruby's fault. new does exist, or else you wouldn't get a new class at all, the catch is that its contents are protected except for a method namely initialize. Instead of making you create the whole AOne class object, Ruby does it for you (you or me or VVulf would get headaches if we had to do it manually by coding that on our own.) Since Ruby's intention is to make it easy for us to make new classes, guess what? It simplified it by making stuff for us and it's free as in beer and freedom of speech. This way we will only change or add stuff that we really care about like your students or their scores.
>= greater than or equal to
if age >= 21
Siletrea.drinks_beer
else
Siletrea.gets_arrested_for_being_a_minor
end
modulo... well, it's a leftover, really, that's all the mystery behind it.
7 % 4 = 3
Why 3? Well, 3 doesn't fit in 4 so we still got 3 guys that couldn't enter in a cabinet to make a phone call to Shanghai while the other 4 are calling people in Minnesota, Hawaii, Guatemala and Turkey.
You may wonder why most classes define a specific method namely initialize
class AOne
def initialize
@teacher = 'Siletrea'
@students = []
@scores = {}
end
end
Well, it tells Ruby, not RGSS, that you need to make a new copy of Class A so every year you can accept new pupils in your AOne class (meaning A-1). You were hired to teach them how to bake stuff in an oven.
In 2016 you did this
@my_class = AOne.new
This year you repeated the same process.
@my_class = AOne.new
Why it isn't called new?
It's complicated, it's Ruby's fault. new does exist, or else you wouldn't get a new class at all, the catch is that its contents are protected except for a method namely initialize. Instead of making you create the whole AOne class object, Ruby does it for you (you or me or VVulf would get headaches if we had to do it manually by coding that on our own.) Since Ruby's intention is to make it easy for us to make new classes, guess what? It simplified it by making stuff for us and it's free as in beer and freedom of speech. This way we will only change or add stuff that we really care about like your students or their scores.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Maranatha!
The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.
My Original Stories (available in English and Spanish)
List of Compiled Binary Executables I have published...
HiddenChest & Roole
Give me a free copy of your completed game if you include at least 3 of my scripts!
Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE