Basics, a dungeon crawler and concrete examples
|
Good day peepz! The programming course has started and I’m super exited for that! The first week has passed and the tempo seems fine. The course is teaching really basic things right now, but I learn stuff anyway. I guess it goes a bit fast for people who have never programmed before but if they keep coding every day and think it’s fun… then they will have no problem! I’ve started creating a dungeon crawler in which I’m learning a lot about the use of classes and objects. I have a long way to go yet, but I think that my current abilities are very good for being a new student here. Here are some examples of what i learned this first week of programming: The modulus operator (%) which tests division for remaining whole numbers. Modulus always returns whole numbers. To explain it further: If a division returns a whole number, the modulus will return a zero (example: 6/3=2. 2 is a whole number so modulus returns a 0, 6%3=0), and if the division doesn’t return a whole number, the “rest” of the devision is outputted (example: 7/3=2.33. the division goes 2 whole times AND a the rest is 1 so modulus returns 1, 7%3=1). Converting float to int and vice versa. When calculating with only integers, the output will always be a whole number. When setting an integer variable to a float value, it disregards the decimal numbers (example 1: 1.10 becomes 1. example 2: 1.99 also becomes 1 because the decimal numbers are disregarded). Hmm, I think that I learned something more from this but I can’t seem to remember right now. Anyway, that’s it. I will try to write more concrete examples like this of what I’m learning from now on! |
