top of page

Pseudocode, Flowchart and Class Diagram Assignment

Updated: Jan 14, 2019

We were given a task to create pseudocode, a flowchart and a class diagram for one of the three options. I chose the Galleon Creator, and did all three for it.


I started off with the pseudocode. Pseudocode is a plan of code, with more English than coding terms. With code, sometimes it's hard to tell what certain features do. With pseudocode, you can explain what certain aspects do and still use code terms.


My code was a lot of fun to write, as I enjoy games that give you choices. This is my pseudocode that I went over.

 


 

I tried to make the code a bit more fun, so I added a pirate voice to the text, as galleons were built around that time period. I also decided to have multiple options for each question, which would give more of a variety of outcomes.


I could've, however, included a few more attributes, and more coding terms. Literature is one of my strong points, so I had fun with this regardless.


 

The next part I did was the flowchart. Flowcharts are a way you can plan how things will turn out, almost like a storyboard. I thought was a good idea to do the flowchart second, and use the pseudocode as an example to work from. While making the flowchart, I realised how big it was going to be. However, it was my intention for the choices to matter a lot when they are made.


While working, I knew there were easier and quicker ways, however, I knew it would've looked even more confusing if I hadn't done it the way I had (even though the complete version looks like a nightmare).


Although there's a lot going on, I have no problem reading this and following the lines, and since the structure of all the paths are the same, it does make sense.


 

The final part was the hardest for me, as I'm still very new to coding. While I understand a few basic principles, I'm not good at actually using them. Class diagrams are a tool that you can plan out different attributes and methods a class will have.


As I did a Galleon Creator, I had to make a class diagram for a galleon. I was a little lost at first as to what should be private and what should be public, but I eventually worked it out.



I worked out that a ship needs to be able to register what the player chose previously, and display all the integers as public. The only one that is on private is Loyalty, which is basically what the player chose in the last question (Pirate or Sailor). I decided it should be private because if this was in a game you wouldn't want random players switching sides.


The methods were difficult for me to describe in short words, and I had to make sure they'd link back to the main attributes. Two of them are also linked. the Speed and the Rips. The speed looks at the amount of sails and the speed would increase accordingly, however, it also needs to look at the rips in the sails if there are any. And if it were realistic, the crew would also be a factor as well.


Another thing to mention would be the fact that the crew could be a class as well, which would include their genders, their overall strength and stamina, and their own loyalties. But as I did want to confuse myself, I stuck with the Galleon class diagram. However, I would be able to make a class diagram for the Crew class if needed.


 

Overall, I feel I have done very well for someone who is new to coding. There are still definitions and parts that don't make a lot of sense, but doing this assignment has showed me that logic is just as important as knowing how to type it out.


Hopefully in the future I can get some more practice with class diagrams, which were the most challenging part, and learn more coding methods to expand what I know.

11 views0 comments

Recent Posts

See All
bottom of page