Week 2 gameprogramming I
|
The second week of the course and I am starting to understand the C++ programming structure. I have a long way to go but this week I got one step closer to creating a game! The focus on my side is to learn “for” loops and how to get functions outside main to work and in what order i should code the functions. I have also learned how to get random values and sort them, how to make a small random map and much more. I have not done all the program exercises but I will get to it later this evening. So a little bit of code then. // My random function below named random. int random(int min, int max) int main(int argv, char* argc[]) int array1[5]; for (int i = 0; i < 5; i++) std::cout << std::endl; // just some space 😀 // run the “for” loop until we have cheeked all the array values. end–; for (int i = 0; i < 5; i++) std::cin.ignore(1024, ‘n’); |