Monday, October 15, 2018

Lab 4 (Week 5 11/10/2018)

Good morning everyone ! The lab for week 5 was very INTERESTING !!! But it quite tough for me. Luckily, my friends taught me patiently and gave me idea to write. Finally , I done my adventure game successfully!

We were asked to create own adventure game. Text adventure game tells story through passage of text revealed to a player in response to typed instructions. The player can go to another situation from an existing situation by typing the command “west”, “down”, “east” ,”up” where the player will be presented with the description of the situation after entering.

 The adventure game was created by using nested if and multi-way if-else statements. The inner if statement is said to be nested inside the outer if statement. The inner if statement can contain another if statement (* There is no limit to the depth of the nesting ). Hence, the situation presented in adventure game is depend on how many "if" used.

Attached with my adventure game program. The user can choose which direction should go based on the choices such as "west", "east", "down" and "up" given. There was just a way to win the game. Otherwise, you will lose the game. You can trial and error in order to win the game.


Are you ready? You can use my source code as references to write your own adventure game. It was really interesting when you running it.

From this lab, I am able to write an adventure game by coding, compiling and running program with the using of multi-way and nested selection statement.
Actually, I wondered how a game is created since I was young. I really so proud of them whose created  a game. Now, I just realised there were a program behind a game. It is not so easy. Hope to explore more in the following lab. See you again ^_^

Lim Xue Ting
183615
SSK3100 (Group15)

Next blog: hennyabigail.blogspot.com (Henny Abigailwillyen Sinjus)


No comments:

Post a Comment

Lab 10 (Week 13 13/12/2018)

Heyyy, we had lab 10 which is our last lab. It is about two dimensional array. What is two dimensional array?? Let me explain it ! The e...