09-06-2017, 08:12 PM
(09-06-2017, 07:50 PM)kyonides Wrote: Well, this kind of ignores all those terms I once explained when you didn't understand why the print command is called like that...
Syntax errors would be the programming equivalent to having a very bad orthography in an essay.
Siletrea wrote modulous #=> NameError! No modulous class or module or method was found!
Did you mean...?
module
modulo
modulus
exponent examples: 2**2 is the same as 2 * 2, 4**2 is the same as 4 * 4, where * asterisk is the symbol you need to make Ruby multiply a number or ** asterisks to get its exponent. In recent versions of Ruby, 2.2+, asterisks have other uses as well. Actually even in Ruby 1.8.1 you can use an asterisk to make an array if it's an argument included in a method definition, i.e.
def my_method(name, *arguments)
print name, arguments.class
end
my_method #=> Pop up window shows up telling you the name you passed through and Array as arguments actual class.
orthography? no idea what that is
and I understood everything up until this point
Quote:exponent examples: 2**2 is the same as 2 * 2, 4**2 is the same as 4 * 4, where * asterisk is the symbol you need to make Ruby multiply a number or ** asterisks to get its exponent. In recent versions of Ruby, 2.2+, asterisks have other uses as well. Actually even in Ruby 1.8.1 you can use an asterisk to make an array if it's an argument included in a method definition, i.e.the point of this thread is to learn from scratch so definining everything is key!
def my_method(name, *arguments)
print name, arguments.class
end
my_method #=> Pop up window shows up telling you the name you passed through and Array as arguments actual class.
but if your using a new big term it has to be explained as well (because I'm sorry that have absolutely no idea what all the big terms are and therefor it doesn't make sense ((this is why I've been trying to explain this in a way that a 6 year old could read because I hope to slowly define all these massive terms so it makes sense)))
I faintly know that "star" * is the term for multiplication 2 * 3 = 6
what is a "asterisk"
is 2 "stars" ** an exponent?
if an array is a box full of numbers used for sorting then does an "asterisk" count as a number?
(I'm sorry if I seem like I'm playing stupid! I'm actually not! this is legit...and also why I wanted to make a full thread as it should help define everything)
new logo for Yesteryear created by Lunarberry!