SE1SA5 - Programming, Final Project (Card Game)
You may have read my review for the final project for Programming (SE1SA5). This project was completed over a number of weeks.
I decided to produce a Card Game over a Text Prediction program as I felt it would be easier and that I could incorporate classes into it more easily to gain credit.
Project progress was monitored by student helpers and members of staff to ensure that the work was under way enough to be completed on time. I felt that it was also good to simulate a real life situation in which it would be expected to show progress throughout the project.
I encountered a few issues whilst programming, as I did not fully understand certain function calls, along with a more specific difficulty in a vast number of instances of a class. I posted a little frustration on how I had initially attempted to implement this on Twitter. Chris Alexander (@chris_alexander) quickly provided a possible solution of 'Class Wrapping', which at first I had to ask the meaning of. This saved me a great deal of work and gave my code readability.
The other issue I had initially was that I was seeding the random number generator each time the random function was called. This meant that I was constantly getting the same random numbers. Patrick Parslow (@PatParslow) aided me with this issue and I learnt that seeding the random number generator should only be done once per program in order to correctly generate random numbers.
Looking back at my program I now realise it would have been more professional and user friendly if I were to prevent an 'infinite loop' (this is not quite true as it quickly causes a stack overflow and stops program execution), which occurred when a user entered anything other than an integer value when prompted for input.
Code
Syntax highlighting thanks to pastie.org
I have some ideas in which to expand upon it, which I may do over the summer as I have, so far, been unable to find a part time job:
I decided to produce a Card Game over a Text Prediction program as I felt it would be easier and that I could incorporate classes into it more easily to gain credit.
Project progress was monitored by student helpers and members of staff to ensure that the work was under way enough to be completed on time. I felt that it was also good to simulate a real life situation in which it would be expected to show progress throughout the project.
I encountered a few issues whilst programming, as I did not fully understand certain function calls, along with a more specific difficulty in a vast number of instances of a class. I posted a little frustration on how I had initially attempted to implement this on Twitter. Chris Alexander (@chris_alexander) quickly provided a possible solution of 'Class Wrapping', which at first I had to ask the meaning of. This saved me a great deal of work and gave my code readability.
The other issue I had initially was that I was seeding the random number generator each time the random function was called. This meant that I was constantly getting the same random numbers. Patrick Parslow (@PatParslow) aided me with this issue and I learnt that seeding the random number generator should only be done once per program in order to correctly generate random numbers.
Looking back at my program I now realise it would have been more professional and user friendly if I were to prevent an 'infinite loop' (this is not quite true as it quickly causes a stack overflow and stops program execution), which occurred when a user entered anything other than an integer value when prompted for input.
Code
Syntax highlighting thanks to pastie.org
I have some ideas in which to expand upon it, which I may do over the summer as I have, so far, been unable to find a part time job:
- Allow user to chose the value of an Ace
- Add support for multiple players
- Prevent the loop on character entry
This project taught me a lot and helped me to apply the knowledge that the module has taught me. It really goes to show how diverse programming can be. Such a wide field makes me want to dabble in a number of different situations. Game development, software development, web development. During the course of the summer I hope to have tried out most of these a bit further than I have already. But first... Exams