project proposalpage - st paul's r.c. academy news...

59
Advanced Higher Computing Project Concentration Card Game Alan Fordyce SQA Number: 063789356 1 | Page Alan Fordyce

Upload: hakhanh

Post on 07-Jul-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

Advanced Higher Computing Project

Concentration Card Game

Alan Fordyce

SQA Number: 063789356

Baldragon Academy, Dundee

1 | P a g eAlan Fordyce

Contents

Project Proposal Page 3 - 5

Project Specification Page 6 - 7

Alternative Solutions Page 8 – 9

Design Page 10-14

Pseudocode Page 15 - 19

Testing Page 20 - 34

User Guide Page 35- 40

Technical Guide Page 41 - 42

Evaluation Page 43 - 46

2 | P a g eAlan Fordyce

Project Proposal

BackgroundCard games are very familiar both on and off computer systems. For my Advanced Higher Project I decided to create a matching card game that would be fun and challenging to play. Playing this game with ordinary cards is very time consuming as the player/s have to constantly flip the cards to show and hide them. The player also needs a large area to lay out the cards. A computer version of this game is much easier as all the player/s have to do is focus on remembering where the cards are located and gaining matches. Playing similar games on a computer system usually involves the player having to visit a webpage and installing the necessary plugins to handle the game. This version will only require an operating system from Microsoft e.g. Windows XP or Windows 7.

Support Programming Games with MS VB 6.0, by Catherine Muir Dwyer and Jeanine Meyer, 2001,

Course Technology, Thomson Learning, USA, pages 43-60 http://www.vbforums.com/showthread.php?t=546633 , Code to Implement a sleep function,

User LaVolpe, Date accessed: 09/12/11 http://www.vbforums.com/showthread.php?t=138280 , Code to implement form and

controls resizing, User Achichincle, Date accessed 06/02/12. Code to get the Windows Username of the current player. I am unable to find the correct

website for this code. Scholar, Standard Algorithms, Sorting Scholar, Data Structures, Implementation of a Record Microsoft DreamSpark, Microsoft Visual Studio, Date accessed 29/11/11,

https://www.dreamspark.com/default.aspx Card Images were taken from Wikipedia, http://en.wikipedia.org/wiki/Playing_card#Styling The Icon Image was taken from Wikipedia,

http://en.wikipedia.org/wiki/File:French_suits.svg

Main Features of the Solution The program should have an attractive background and card design The user should be able to exit the game at any time The program should continue until all matches have been made The program should time the player and display it at the end The program should store 50 user names and times The program should be able to display the best 50 times in descending order The program should show all the card values at the start then flip them over to start the

game The program should allow the user to replay until they decide to quit

3 | P a g eAlan Fordyce

The program should allow the user to search the best times for their name and display them

The program should display the current time and matches while playing The program should allow the user to view the cards again for help The program should have a help feature such as a walkthrough or tutorial The program should provide feedback that is easy to understand The program should provide the user with audio feedback

Hardware, Software and Resources NeededTo complete this program I will require a computer that is capable of running and has the chosen Software Development application installed. Front and back images of a full deck of cards will be required for the program. The computer will also require a graphics application to make edits to the card images. The graphics application I will use is the pre-installed Windows ‘Paint’ application by ‘Microsoft’. The application will be used to resize and crop the card images. To edit the audio files the application ‘Audacity’ created by ‘The Audacity Team’ will be used.

Stage Estimated TimeAnalysis 5 Hours

Design 4 Hours

Language Learning 1 Hour

Implementation 20 Hours

Testing 5 Hours

Documentation 5 Hours

Evaluation 5 Hours

4 | P a g eAlan Fordyce

Gant Chart45 March44 February43 February42 February41 February40 February39 February38 February37 February36 February35 February34 January33 January32 January31 January30 January29 January28 January27 January26 December25 December24 December23 December22 December21 December20 December19 November18 November17 November16 November15 November14 November13 November12 November11 November10 October9 October8 October7 October6 October5 September4 September3 September2 September1 September

Hours

Analysis5 Hours

Design4 Hours

Learning Language

1 Hour

Implementation20 Hours

Testing5 Hours

Documentation5 Hours

Evaluation5 Hours

5 | P a g eAlan Fordyce

Project Specification

Scope and ObjectivesThe scope of the project is to create a program which simulates the card game known as ‘Concentration’ (Memory). The objective of the project is to simplify the playing of Concentration by randomly shuffling cards and turning them over when chosen to speed up the game for the player.

ActivitiesTo complete the project the program will have to be designed based on the specification. The necessary resources will have to be obtained and edited for use in the program. The user interface and the program code will have to be designed. The rules of the game will have to be identified and included in the program. Implementation of the program in my chosen programming language will be carried out. The project will be tested based on the specification.

The SolutionThe finished program will need to be usable so it will have to handle the rules of the game and be able to respond to user inputs. The solution will have to output feedback to the user which is easy to understand. This includes rule breeches, animation and scoring.

BoundariesTo create this game within the time-scale of Advanced Higher the solution will need to be limited. The game should be able to do all the features outlined earlier and should not be expanded upon. One feature that I will not include is a difficulty setting, which is included in similar programs to make the game easier or harder. This will create a fun and challenging game within the level of Advanced Higher that will not take a large time-scale to complete.

Issues of Feasibility

EconomicThere are no costs involved with creating this project as all resources and support are available for free from various sources.

LegalThe images that will be used for the program will be taken from Wikipedia under their GFDL license. This license allows the images to be used and modified for commercial or non-commercial use. Microsoft Visual Studio 6 can be acquired from Microsoft Dreamspark’s Website.

6 | P a g eAlan Fordyce

TimeThe project has timescales in place to make sure that the finished program is completed before the hand in date.

TechnicalThe necessary technology is available to create this program.

7 | P a g eAlan Fordyce

Alternative Solutions

Present SolutionTo currently play the game of Concentration you can either use real cards or visit a Website and play the game in your Browser.

DrawbacksTo play Concentration with real cards the player/s have to gather and shuffle the cards. They also constantly have to flip over the cards until all matches have been made. This can be time-consuming and cards may get muddled up as the game progresses.

Playing concentration on a Browser website requires that the correct plug-ins are installed to run the embedded application. Most internet applications are in flash which can be very unstable on some systems causing the player to lose their progress. An internet connection constantly must be required to play the game which may not be available for some players.

Criteria used to compare methods1. Can an appropriate HCI be created using this tool?2. What type of language is it and is it suitable?3. Is the language available for me to use?4. Does the program have High Level Language constructs that are complex enough for an

Advanced Higher Program?5. Do I have any experience with the programming environment?

Software Development Environments Available Flash Java Visual Basic Python

Language ComparisonFlash Java Visual Basic Python

1. Creation of HCI

From my past experiences with flash applications (such as browser games) I have seen that HCIs can be made. A HCI appropriate to this program can be

Also from past experience with Java applications (browser games etc.) I have seen that appropriate HCIs can be made for my program.

Visual Basic allows objects to be dragged and dropped using a GUI. Each object can be linked to sections of code. This allows a HCI to be easily implemented and changed

Python uses toolkits to allow a programmer to program a GUI to meet their needs based on the toolkit they choose

8 | P a g eAlan Fordyce

made2. Type of language

Flash is an Object-Oriented language. Flash is suitable to create this program

Java is an Object-Oriented language which is suitable to create this program

Visual Basic is a Procedural Language with elements of an Object based language. Visual Basic is suitable because it works based on user interaction which is needed for this program

Python is primarily an Object-Oriented language with elements of procedural and other types. Python is suitable to create this program

3. Is the language available?

The language is open-source and works with several open-source compilers. Although none of these compilers can be installed on the School Computer System which limits the languages use to Home

GNU Compilers are available to install and use but none of these compilers can be installed which limits me to home use

Visual Basic is installed with Visual Studio on most School computers. It is also available to download from Microsoft DreamSpark, which I have access to

The language and compiler are open-source but as with the previous languages the compliers cannot be installed on the School Computer System

4. Complex High Level Language Constructs

From my studies into this language I have found that this language has the necessary High Level language constructs available

From my past experience I believe this language has the necessary High Level Constructs available to satisfy an Advanced Higher Project

Visual Basic has the necessary High Level Constructs needed. Code can be used to access files, create multi-dimensional arrays and implement searching and sorting

Other students in my class are using this language to create their Advanced Higher Project, from this I know that this language has the necessary High level Language constructs available

5. Personal experience

I have no experience in this language. Learning this language to a level suitable for Advanced Higher will take a large amount of time.

I have limited experience with this language but not enough to be able to use the language to create a program at a level suitable for Advanced Higher.

I have used Visual Basic since Standard Grade so I have the necessary experience to complete the project with this language.

I have no experience in this language. Learning this language may be faster than the others because of the amount of help available online.

ConclusionAlthough each of the languages above can be used to create this program I only have experience in one of them. Visual basic is the best choice for programming because I have the most experience in this language and have code available from other programs which can be integrated into my program. Visual Basic is the most readily available language I can use because all school computers have Microsoft Visual Studio installed as well as my home computer which was obtained from Microsoft DreamSpark.

9 | P a g eAlan Fordyce

Design

User InterfaceThe following section will describe the User Interface of each screen on my program. The screens are; Main Menu, High Scores, How to Play, Rules and the Game Board. The User Interface of my program will be a Graphical User Interface with an attractive layout that is easy to use and can provide meaningful feedback to the player to allow them to enjoy the game to the fullest. Each screen will have a button that will take the player back to the main menu if needed.

Main MenuThe Main Menu Interface will contain a small intro to the game, an easy to understand layout and buttons that link to the other forms in the program. These buttons have links to; an instruction screen to show the player how to play the game; a screen that displays the rules of the game; a screen that allows the player to play the game; exiting the game; and a screen that displays the list of high scores.

High Scores The High Scores interface will contain a locked text box in the middle of the form that will output all the High Scores in an easily understandable format. The background colour will be the default Visual Basic grey with black font for text.

10 | P a g eAlan Fordyce

Menu Buttons

Game Title, Information about the game. SQA

Details etc.

How to PlayThe how to play interface will be split up into steps each separated by a black line. Each step will contain text and an image showing an example of the step. The lines will be thick enough to stand out as separators while both the text and lines will be coloured black. The background colour will be the default visual basic grey.

11 | P a g eAlan Fordyce

Menu Buttons

High Scores Output

RulesThe Rules interface will contain a locked text box in the middle of the screen with a button to return to the main menu when needed. The locked text box font colour will be black with the form using the default Visual Basic grey background colour. The rules of the game are;

Only two cards can be picked in one try. The picked cards must be of the same rank, colour does not matter, to gain a match. The game should only be played with one player. The player has to successfully match 26 cards to complete the game. The cards will be turned over and one added to the amount of tries if the match is unsuccessful.

12 | P a g eAlan Fordyce

Menu Buttons

Separators

Images

Game BoardI have decided to create the Game Board Interface in Black, White and Green to simulate a real Card Board. The card images on the Game Board will be in Black and Red to help identify their suit. The Card Images have a number (or letter) to identify them and also have a suit image.

The Game Board Interface will provide the player with a real-time update on their current score, which includes Time, Tries and Matches and this information will be easily identifiable along the bottom of the Board. This will provide meaningful feedback to the player. The game board includes options such as; Restart; Main Menu; Reveal Cards and Begin a New Game. The Game Board will also have links to the How to Play and Rules screen if the player needs them.

13 | P a g eAlan Fordyce

Menu Buttons

Rules Output

14 | P a g eAlan Fordyce

Menu Buttons

Playing Area. Space for 52 Cards

Current Game Scores

Pseudocode

Main Menu1. Get the current Windows Account name from the System.

1. Check if the Name has already been found (the program will have links to the main menu so there is no point in getting this again).

2. Ask the user if they would like to use this name or input their own.1. If they decide to input their own show an input box and store the name.

3. Set the Global variable PlayerUserName to either the Windows Account name or a user-defined name.

2. Check if the High Scores file exists and if not then create it.3. Show the Main Menu Interface to the user and wait for a click on one of the buttons.

1. If the User clicks the High Scores button then load the high scores form and close the main menu.

2. If the User clicks the How to Play button then load the How to Play form and close the main menu.

3. If the User clicks the Rules button then load the Rules form and close the main menu.4. If the User clicks the Start button then load the Game Board form and close the main menu.5. If the User clicks the Exit button then end the program.

High Scores1. Get the High Scores from the External Text File.

1. Set Count = to 1 for the number of Lines in the file, starting from line 1.2. Open the External File for Input.3. Begin Loop.4. Get the Text on the Current Line represented by Count in the string HighScoresTemp.5. Set Temp = “”6. Get the first two characters from the HighScoresTemp string into the Temp string.7. If the first character in Temp is a 0 then only the second number is needed.8. Do steps 5-7 for the 4th and 5th characters in the HighScoresTemp string.9. Do steps 5-7 for the 7th and 8th characters in the HighScoresTemp string.10.Get the Player name which starts from the tenth character until the end of the line.11.Convert the Strings to Integers and store them in the High_Scores record array.12.Set Contents = to Contents + a formatted output of the High_Scores record array.13.Add one to Count.14.Loop Until the End of the File.

2. Set the Text Box to Contents.

How to PlayNone

Rules1. Open the External Rules text file.2. Begin Loop.3. Get the current line text and store it in a string.

15 | P a g eAlan Fordyce

4. Add the contents of the string into the textbox.5. Loop Until the End of the File.

Game Board1. Get the User Name from the Global variable and set a label to display it.2. Show the Best Time for the current User Name (if any exists).

1. Set Count = to 1 for the number of Lines in the file, starting from line 1.2. Open the External File for Input.3. Begin Loop.4. Get the Text on the Current Line represented by Count in the string HighScoresTemp.5. Set Temp = “”6. Get the first two characters from the HighScoresTemp string into the Temp string.7. If the first character in Temp is a 0 then only the second number is needed.8. Do steps 5-7 for the 4th and 5th characters in the HighScoresTemp string.9. Do steps 5-7 for the 7th and 8th characters in the HighScoresTemp string.10. Get the Player name which starts from the tenth character until the end of the line.11. Convert the Strings to Integers and store them in the High_Scores record array.12. Add one to Count.13. Loop Until the End of the File.14. Set the Users best Minutes and Seconds score to 99.15. Counter for the Number of Items in the Array.

1. If Minutes(Counter) is less than the Users Best Minutes score and if the User Names are equal then set the Users Best Minutes Score to Minutes(Counter), the Users Best Seconds Score to Seconds (Counter) and the Users Best Tries to Tries(Counter).

2. Else if the Minutes(Counter) = The Users Best minutes and the User Names match then check if the Seconds(Counter) is less than the Best Seconds. If it is less then set the Users Best Seconds to Seconds(Counter) and Best Tries to Tries(Counter).

3. Next Counter16. Set the Labels to display the Users Best Score.

3. Wait until the User Clicks Start or Clicks on any of the Buttons.1. If the User Clicks start then Skip to Step 4.2. Other Buttons that the user can click are below this section.

4. Load and play the Start sound.5. Initialize the temporary card arrays, 4 of them in total.6. Initialize the filled Boolean array and set all of them to false7. Generate a random value for the first quarter of the cards and check that there is only 1 card of

each.1. Counter for all the 13 values in the Card integer array.2. Generate a random number between 1 and 13.3. Begin Loop4. Check if the card value exists5. If the value exists then generate a new random number, set valid to false. If the value does

not exist then exit then set valid to true.6. Loop until Valid = true

8. Repeat Step 7 for the second quarter of cards.9. Repeat Step 7 for the third quarter of cards.10.Repeat Step 7 for the fourth quarter of cards.

16 | P a g eAlan Fordyce

11.Add the first, second, third and fourth quarter values to the fulldeck array, which holds 52 values.12.Using the fulldeck array values and an array of Imageboxes set the first quarter of the cards to Club

images based on their number e.g. a value of 1 becomes a Club Ace image.13.Using the fulldeck array values and an array of Imageboxes set the second quarter of the cards to

Diamond images based on their number e.g. a value of 1 becomes a Diamond Ace image.14.Using the fulldeck array values and an array of Imageboxes set the third quarter of the cards to

Spade images based on their number e.g. a value of 1 becomes a Spade Ace image.15.Using the fulldeck array values and an array of Imageboxes set the fourth quarter of the cards to

Heart images based on their number e.g. a value of 1 becomes a Heart Ace image.16.Counter for all the card and back Imageboxes. Set the Back Imageboxes visible property to false. Set

the Card Imageboxes visible property to true. This allows the player to see all the cards at the start.17.Disable and enable the required menu functions for the game.18.Start the timer with an interval of one second.

1. Add one to the StartShowSeconds Integer variable.2. Set the Label to display the value of 7 – StartShowSeconds.3. If StartShowSeconds is greater or equal to 7 then hide the Cards.

1. Counter for all the Card and Back Imageboxes. Set the Card Imageboxes visible property to false. Set the Back Imageboxes visible property to true.

19.Start the timer with an interval of one second. This loops throughout the program.1. Add one to the CurrentSeconds Integer variable every interval.2. Set the Time label to display the CurrentMinutes and CurrentSeconds value every interval.3. If CurrentSeconds is greater than 59 then add one to CurrentMinutes Integer variable and

Play the Minute sound file.20.Loop until all matches have been made. Wait until the user clicks a Back image box.

1. If the User’s first choice is 0 then set UserChoice(1) to the clicked card value by using the Array of Imageboxes and the FullDeck array.1. Hide the clicked back Image box and show the clicked card Image box.2. Set the HideBack variable to the back array Index value.3. Add one to the CardsClicked integer variable.

2. If the User’s first choice is not 0 and the User’s second choice is 0 then set UserChoice(2) to the clicked card value.1. Hide the clicked back Image box and show the clicked card Image box.2. Add one to the CardsClicked integer variable.3. Pause the program and show the two clicked cards

3. If the CardsClicked variable = 2 then.1. Set CardsClicked to 0.2. Add one to the number of Tries.3. Check if UserChoice(1) = UserChoice(2).

1. If they equal then.1. Add one to Matches.2. Play the Match sound.3. Disable the first card and back using the HideBack value.4. Disable the second card and back by using the Index value.5. Set the Matches label to the new Matches value.

2. If they don’t equal then.1. Play the No Match sound.

17 | P a g eAlan Fordyce

2. Show the Back Imageboxes and hide the card Imageboxes.21.When all the Matches have been made.

1. Stop the Timer.2. Play the Win Sound.3. Hide all the Back Imageboxes and set the Card Imageboxes to the Win Image.4. Display the Users score.

22.Save the Users Score in the High Score file.1. Check how many entries are in the High Score file.

1. Open the file for input.2. Loop until end of file.3. Get the text on each line.4. Add one to the number of lines.5. End loop and close the file.

2. Check the number of lines.1. If the Number of lines is less than 50.

1. Open the High Scores file for append.2. Check if the Minutes have only one digit and if so add a 0 before it.3. Check if the Seconds have only one digit and if so add a 0 before it.4. Check if the Tries have only one digit and if so add a 0 before it.5. Print the User’s Minutes, Seconds, Tries and Name to the file.6. Close the file

2. If the number of lines is equal or greater than 50.1. Open the High Scores file for output.2. Counter for the High Scores 1 to 49.3. Check if the Minutes have only one digit and if so add a 0 before it.4. Check if the Seconds have only one digit and if so add a 0 before it.5. Check if the Tries have only one digit and if so add a 0 before it.6. Print the Minutes, Seconds, Tries and Name to the file.7. End Counter.8. Check if the New Minutes have only one digit and if so add a 0 before it.9. Check if the New Seconds have only one digit and if so add a 0 before it.10.Check if the New Tries have only one digit and if so add a 0 before it.11.Print the User’s Minutes, Seconds, Tries and Name to the file.12.Close the file.

23.Sort the High Score File.1. Counter for all the 50 High Scores.2. If the Player Name is blank then use a dummy Minutes, Seconds and Tries value of 99.3. End Counter.4. For Outer = 1 to 50.5. For Inner = 1 to 50.6. If the Minutes(Outer) are greater or equal to the Minutes(Inner).

1. If the Seconds(Outer) are greater than the Seconds(Inner).1. Set Minutes Temp to Minutes(Outer).2. Set Minutes(Outer) to Minutes(Inner).3. Set Minutes(Inner) to Minutes Temp4. Set Seconds Temp to Seconds(Outer).

18 | P a g eAlan Fordyce

5. Set Seconds(Outer) to Seconds(Inner).6. Set Seconds(Inner) to Seconds Temp7. Set Tries Temp to Tries(Outer).8. Set Tries(Outer) to Tries(Inner).9. Set Tries(Inner) to Tries Temp.10. Set Player Name Temp to Player Name (Outer).11. Set Player Name (Outer) to Player Name (Inner).12. Set Player Name (Inner) to Player Name Temp.

2. If Minutes(Outer) are less than Minutes(Inner).1. Set Minutes Temp to Minutes(Inner).2. Set Minutes(Inner) to Minutes(Outer).3. Set Minutes(Outer) to Minutes Temp.4. Set Seconds Temp to Seconds(Inner).5. Set Seconds(Inner) to Seconds(Outer).6. Set Seconds(Outer) to Seconds Temp.7. Set Tries Temp to Tries(Inner).8. Set Tries(Inner) to Tries(Outer).9. Set Tries(Outer) to Tries Temp.10. Set Player Name Temp to Player Name (Inner).11. Set Player Name (Inner) to Player Name (Outer).12. Set Player Name (Outer) to Player Name Temp.

7. Next Inner, Next Outer8. Open the High Scores file for output.9. Counter for the High Scores 1 to 50.10. If the Player Name is blank then add one to counter.11. Check if the Minutes have only one digit and if so add a 0 before it.12. Check if the Seconds have only one digit and if so add a 0 before it.13. Check if the Tries have only one digit and if so add a 0 before it.14. Print the Minutes, Seconds, Tries and Name to the file.15. End Counter.

Pseudocode for User Interaction Code If the User decides to Exit the Program or Clicks the Main Menu button then ask them if they are

sure. If the User clicks the Rules button then show the Rules window. The game will continue running in

the background. The User can exit the Rules window by clicking the Red Cross at the top right and return to their game.

If the User clicks the How to Play button then show the How to Play window. The game will continue running in the background. The User can exit the How to Play window by clicking the Red Cross at the top right and return to their game.

19 | P a g eAlan Fordyce

Testing

Create Test DataTo fully test my program test data has to be created that can fully push the program to its boundaries or even further by causing a crash or error during execution. This will ensure that all errors and bugs are discovered before the program leaves the programmer (Me) which can then be corrected. Individual procedures will be tested to make sure they take the correct inputs and give the correct outputs. The whole program will be played several times to make sure it works from start to end without any errors or bugs and to ensure it gives the correct outputs. The procedures will be listed in order from the start of the program to the exit of the program.

Main MenuThe Main Menu has one variable it needs to get from the User and needs to respond to a user clicking on Menu buttons.

No. Activity Input Expected Result Reason for Choosing1 Get the Player

Name into strUserName.

“Use the Windows Account Name”, Yes.

The program will set the strUserName variable to my school login account name.

To check that the program can get the username of the current user.

2 Get the Player Name into strUserName.

“Use the Windows Account Name”, No.Type “Alan” into the Input box.

The program will set the strUserName variable to “Alan”.

To check that the program can get a custom name from the user.

2.5 Get the Player Name into strUserName via an Input box.

Type “12345qwerty!”£$%” into the Input box.

The program will set the strUserName variable to “12345qwerty!”£$%”.

To check that the program accepts special characters or numbers.

3 Click the “Start the game” button.

Click Button: “Start the game”.

The Main Menu will disappear and the Game Board will show.

To check that the user can get to the game board to play the game.

4 Click the “How to play” button.

Click Button: “How to play”.

The Main Menu will disappear and the How to play window will show.

To check that the user can get to the How to Play instructions.

5 Click the “Game Rules” button.

Click Button: “Game Rules”.

The Main Menu will disappear and the Game Rules window will show.

To check that the user can get to the Game Rules.

6 Click the “View High Scores” button.

Click Button: “View High Scores”.

The Main Menu will disappear and the High Scores window will show.

To check that the user can get to the High Scores.

7 Click the “Exit the game” button.

Click button: “Exit the game”.

The program will close. To check that the user can exit the program.

How to PlayThe How to Play Window has no Variables and only needs to respond to the User clicking the “Return to Main Menu” Button.

No. Activity Input Expected Result Reason for Choosing1 Click the “Return

to Main Menu” button.

Click button: “Return to Main Menu”.

The How to Play Window will disappear and the Main Menu will show.

To check that the user can get to the Main Menu from the How to Play Window.

20 | P a g eAlan Fordyce

Game RulesThe Game Rules Window needs to open an external text file and load the contents into a Textbox. The Rules Window has 1 variable, a text box and a button to return to the Main Menu

No. Activity Input Expected Result Reason for Choosing1 Click the “Return

to Main Menu” button.

Click button: “Return to Main Menu”.

The Rules Window will disappear and the Main Menu will show.

To check that the user can get to the Main Menu from the Rules Window.

2 Get the Rules from the External File into the Textbox.

Text from an External File into RulesText variable.

The program will get all text from the file and display it in the Textbox.

To check that the user can view the rules.

High ScoresNo. Activity Input Expected Result Reason for Choosing1 Click the “Return

to Main Menu” button.

Click button: “Return to Main Menu”.

The High Scores Window will disappear and the Main Menu will show.

To check that the user can get to the Main Menu from the High Scores Window.

2 Load the Window to get the High Scores.

Click the High Scores button on the Main Menu.

The High Scores Window will appear with the Textbox filled with the High Scores from the High Scores file.

To check that the program can successfully get the correct High Scores and display them.

Game BoardNo. Activity Input Expected Result Reason for Choosing1 Click the “Return

to Main Menu” button.

Click button: “Return to Main Menu”. Click Message box button: “Yes”.

The Game Board Window will disappear and the Main Menu will show.

To check that the user can get to the Main Menu from the Game Board Window.

2 Click the “Return to Main Menu” button.

Click button: “Return to Main Menu”. Click Message box button: “No”.

The Game Board Window will not disappear.

To check that the user can cancel exiting the Game Board if they accidentally press the wrong button etc.

3 Click the “How to Play” button.

Click button: “How to Play”.

The How to Play window will appear and the Game Board will stay visible.

To check that the user can view the How to Play information while the Game is running.

4 Click the “Rules” button.

Click button: “Rules”. The Rules window will appear and the Game Board will stay visible.

To check that the user can view the Rules while the Game is running.

5 Click the “Mute Audio” button.

Click button: “Mute Audio”.

The program will no longer play any sound during the game.

To check that the player can Mute the game while playing.

6 Click the “Unmute Audio” button.

Click button: “Unmute Audio”.

The program play sounds again during the game.

To check that the player can unmute the game while playing.

7 Click the “Exit Game” button.

Click button: “Exit Game”. Click Message box button: “Yes”.

The program will close. To check that the user can exit the program.

8 Click the “Exit Game” button.

Click button: “Exit Game”. Click Message box button: “No”.

The program will not close. To check that the user can cancel exiting the Game if they accidentally press the wrong button etc.

21 | P a g eAlan Fordyce

9 Form Load. Get High Scores and the Best Score for the Player.

The program will get the High Scores from the external file into the High_Scores Record. The program will get the Best Score for the Current User.

To check that the program can load the High Scores and to check that the program can get the Best Score for the Current Player so they have a target to beat.

10 Sort the High Scores file

The program will use a simple sort to sort the High Scores file based on the best to worst time. The High Scores file will be sorted.

To check the program can sort the High Scores file so no problems arise later from an unsorted list.

11 Click the “Begin the Current Game” button. Generate the Random Numbers for the Cards.

Click button: “Begin the Current Game”.Random numbers into Card1, Card2, Card3 and Card4 integer variables.

The random numbers for all the cards will be generated and placed into the FullDeck variable. There will be an even amount of each card e.g. two 2 of Spades or four King of Clubs.

To check that the program can generate an even number of random values to fill the cards with.

12 Fill the Imageboxes with the correct card images based on the random numbers.

FullDeck integer variable.

The Imageboxes will be filled with the random integer numbers from the FullDeck integer variable.

To check that the program can display the cards in their correct position based on the FullDeck variable.

13 Show all the cards to the player.

The Card Images will be shown to the player.

To give the player a hint of where the cards are located as the game starts.

14 Hide the cards after seven seconds.

StartShowSeconds integer variable is greater or equal to 7.

The Card Images will be hidden and the Back Images will be shown.

To check that the cards can be hidden after the player has been given a hint.

15 Click one card. Click one back image box. UserChoice(1) integer variable is empty.

The back Image box will be hidden and the Card Image box will be shown. UserChoice(1) integer variable will be set to the Card Number based on the FullDeck integer variable.

To check that the player can select a card to match.

16 Click a second card.

Click on a second back Image box. UserChoice(1) integer variable is not empty. UserChoice(2) integer variable is empty.

The back Image box will be hidden and the Card Image box will be shown. UserChoice(2) integer variable will be set to the Card Number based on the FullDeck integer variable.

To check that the player can select two cards.

17 Check for a match.

UserChoice(1) and UserChoice(2) integer variables are both not empty.

The program will check if UserChoice(1) and UserChoice(2) equal.

To check that the program can check for a match.

17.5 UserChoice(1) and UserChoice(2) match.

UserChoice(1) and UserChoice(2) match.

The program will play the match sound (unless the mute button has been pressed) and add one to Matches. The matched cards will be hidden. One will be added to tries.

To check that when a match is found the program can respond.

17.5 UserChoice(1) and UserChoice(2) do

UserChoice(1) and UserChoice(2) do not

The program will play the No Match sound. One will be

To check that when a match is not found the program can

22 | P a g eAlan Fordyce

not match. match. added to tries. The cards Imageboxes will be hidden and the back Imageboxes shown.

respond.

18 Click more than two cards.

Click three or more cards.

The program will display a message telling the user to play the game properly and will not register and matches.

To check that a player cannot break the rules by clicking a large amount of cards.

19 Time goes above 99 Minutes.

The program will display a message saying the player has lost and allowing them to restart.

To check that the play time cannot go higher than 99 minutes which will break the High Scores.

20 Tries goes above 99.

The program will display a message saying the player has lost and allowing them to restart.

To check that the Tries cannot go higher than 99 as this will break the High Scores.

21 All 26 Matches have been made.

Matches = 26. The program will play the win sound. All the card Images will be changed to Win Images and shown. The program will display the Users score. The program will ask the User if they want to view the High Scores.

To check that the program can respond to the Player matching all the cards.

21.5 Click “Yes” to viewing the High Scores.

Click Input box button: “Yes”.

The Game Board will disappear and the High Scores window will display.

To check that the Player can view the High Scores after a game.

21.5 Click “No” to viewing the High Scores.

Click Input box button: “No”.

The Game Board will disappear and the Main Menu will show.

To check that the Player can leave a finished game and return to the Main Menu.

23 | P a g eAlan Fordyce

Initial TestingInitial testing was carried out while implementing the program in Visual Basic. Visual Basic allows the programmer to run the programmer while it is still being implemented. This is useful as it allows the programmer to test the code as new code is added. The following problems were discovered:

Most bugs encountered were due to typing errors such as Variables not being spelt correctly. The Code for generating the Random Numbers used for the cards did not function correctly. The

code was not creating a double for each card which made the game unwinnable. The code to show all the cards again caused the sleep timer to break; this meant that the player

could not see the second card image when they clicked on it. The player could freeze the program if they tried to select three or more cards while playing the

game. The code to get the best score for the current player could not find any values lower than one. The High Score code could not recognise values of 0. The code to play sound would not function. Using an executable and loading the game board would show an error message and crash if Visual

Basic was not installed on the system.

Once identified the problems above were all fixed except from two. The ‘Show all cards again’ function was removed and the Crash if Visual Basic was not installed was ignored. This was ignored because a final version of this program could be packaged with the required Component which would make it work without Visual Basic.

Testing Using Test DataThe following steps were followed in order unless the same procedure was needed by the next step or the Window was closed by clicking a button e.g. clicking the “Game Rules” button on the Main Menu. If the window was closed the program was restarted and testing continued from the next point.

Main MenuThe Main Menu has one variable it needs to get from the User and needs to respond to a user clicking on Menu buttons.

24 | P a g eAlan Fordyce

No.

How it Was Tested Expected Result Actual Result

1 Started the program using run in Visual Basic with a breakpoint at the end of the form_load procedure.

The program will set the strUserName variable to my school login account name.

The strUserName variable was set to my school account login name. This name is the same one I use to log into the School Network.

2 Started the program using run in Visual Basic with a breakpoint at the end of the form_load procedure.

The program will set the strUserName variable to “Alan”.

The strUserName variable was set to ‘Alan’.

2.5 Started the program using run in Visual Basic with a breakpoint at the end of the form_load procedure.

The program will set the strUserName variable to “12345qwerty!”£$%”.

The strUserName variable was set to 12345qwerty!”£$%”.

3 Clicked the button and waited for the Window to appear.

The Main Menu will disappear and the Game Board will show.

The Main Menu disappeared and the Game Board was shown.

4 Clicked the button and waited for the Window to appear.

The Main Menu will disappear and the How to play window will show.

The Main Menu disappeared and the How to Play Window was shown.

25 | P a g eAlan Fordyce

5 Clicked the button and waited for the Window to appear.

The Main Menu will disappear and the Game Rules window will show.

The Main Menu disappeared and the Game Rules Window was shown.

6 Clicked the button and waited for the Window to appear.

The Main Menu will disappear and the High Scores window will show.

The Main Menu disappeared and the High Scores Window was shown.

7 Clicked the button and waited for the program to close.

The program will close. The program closed.

How to PlayThe How to Play Window has no Variables and only needs to respond to the User clicking the “Return to Main Menu” Button.

No.

How it Was Tested Expected Result Actual Result

1 Started the program using an executable, opened the How to Play window then clicked the ‘Main Menu’ button.

The How to Play Window will disappear and the Main Menu will show.

The how to play window closed and the Main Menu was shown.

26 | P a g eAlan Fordyce

Game RulesThe Game Rules Window needs to open an external text file and load the contents into a Textbox. The Rules Window has 1 variable, a text box and a button to return to the Main Menu.

No.

How it Was Tested Expected Result Actual Result

1 Started the program using an executable, opened the Rules window then clicked the ‘Main Menu’ button.

The Rules Window will disappear and the Main Menu will show.

The rules window closed and the Main Menu was shown.

2 The Rules window was opened from the Main Menu.

The program will get all text from the file and display it in the Textbox.

When the Rules window was opened the text appeared in the Text box. The text was checked against the External Rules file and found to match.

27 | P a g eAlan Fordyce

High Scores

No.

How it Was Tested Expected Result Actual Result

1 Started the program using an executable, opened the High Scores window then clicked the ‘Main Menu’ button.

The High Scores Window will disappear and the Main Menu will show.

The High Scores Window closed and the Main Menu opened.

2 Started the program using an executable then opened the High Scores window. Checked the Contents of the Textbox with the contents of the Text File.

The High Scores Window will appear with the Textbox filled with the High Scores from the High Scores file.

The High Scores Textbox and Text File match. The High Scores Textbox is formatted correctly with the information in the High Scores File.

Game BoardNo. How it Was Tested Expected Result Actual Result

1 Started the program using an executable, opened the Game Board then clicked the ‘Main Menu’ button. Clicked Yes on the Confirm Box.

The Game Board Window will disappear and the Main Menu will show.

The Main Menu opened as soon as the Main Menu button was clicked. The confirmation appeared afterwards. Clicked Yes and the Game Board closed. The Actual Result did not match the Expected.

2 Started the program using an executable, opened the Game

The Game Board Window The Main Menu opened as soon as the Main Menu button was clicked. The

28 | P a g eAlan Fordyce

Board then clicked the ‘Main Menu’ button. Clicked No on the Confirm Box.

will not disappear. Confirmation appeared afterwards. Clicked No. The Game Board did not close but the Main Menu was still visible. The Actual Result did not match the Expected.

3 Opened the Game Board then clicked the How to Play button.

The How to Play window will appear and the Game Board will stay visible.

The How to Play window opened and the Game Board was still open.

4 Opened the Game Board then clicked the Rules button.

The Rules window will appear and the Game Board will stay visible.

The Rules window opened and the Game Board was still open.

5 Opened the Game Board, clicked the Begin button. Clicked on a card to hear sound. Clicked the Mute button. Clicked on another card to hear sound.

The program will no longer play any sound during the game.

The sound still played after the Mute button was clicked. The Actual Result did not match the Expected.

6 Clicked the Unmute button after doing No. 5 then clicked on a card.

The program play sounds again during the game.

The sound was already playing from a bug in No. 5. The Actual Result did not match the Expected.

7 Clicked the Exit button. Clicked Yes on the confirmation.

The program will close. The program closed.

8 Clicked the Exit button. Clicked No on the confirmation.

The program will not close. The program did not close.

9 Opened the High Scores file and edited the High Scores. My best score was set to 2 Minutes and 25 Seconds with 47 Tries. Used Visual Basic to run the program with breakpoint to check the Best variables.

The program will get the High Scores from the external file into the High_Scores Record. The program will get the Best Score for the Current User.

The variables were set to the correct score and the program displayed my best score formatted correctly.

10 Opened the High Score file and used Cut and Paste to move items about. Put the best time in the middle. Opened the Game Board then checked the High Scores file again.

The program will use a simple sort to sort the High Scores file based on the best to worst time. The High Scores file will be sorted.

The High Scores file was sorted from lowest to highest based on time.

11 Added code to have the program output the Random Numbers to a

The random numbers for all the cards will be generated

Every card had a double which it could be matched with.

29 | P a g eAlan Fordyce

Text file. Used the Text file to check that there was an even amount of each number. Added a breakpoint after the Random Number generation to pause the execution.

and placed into the FullDeck variable. There will be an even amount of each card e.g. two 2 of suite or four King of suite.

12 Continued after the Breakpoint in No. 11 with another Breakpoint placed after all the cards were filled and shown. Checked the Card Images against the Text file from No. 11.

The Imageboxes will be filled with the random integer numbers from the FullDeck integer variable.

The Images in the Imageboxes matched the Random values that were outputted into the Text File.

13 Tested in No. 12 using a breakpoint after the code to show the cards.

The Card Images will be shown to the player.

The Card Images were shown correctly.

14 Opened the Game Board and started a New Game.

The Card Images will be hidden and the Back Images will be shown.

The Card Images were shown then a timer appeared indicating the time left until the cards would be hidden. The cards were hidden after seven seconds.

15 Started a Game with breakpoints during the Card Click code to find the value of UserChoice(1). Checked that this value was the same as the Card that was shown on Screen.

The back Image box will be hidden and the Card Image box will be shown. UserChoice(1) integer variable will be set to the Card Number based on the FullDeck integer variable.

The back image box was hidden and the card image box was shown. UserChoice(1) was set to the value of the card as shown on screen.

16 Continued from the Breakpoint in 15 with another breakpoint during the Card Click code to find the value of UserChoice(1). Checked that this value was the same as the card that was shown on screen.

The back Image box will be hidden and the Card Image box will be shown. UserChoice(2) integer variable will be set to the Card Number based on the FullDeck integer variable.

The back image box was hidden and the card image box was shown. UserChoice(2) was set to the value of the card as shown on screen.

17 Continued from the Breakpoint in 16 with another breakpoint at the end of the procedure. Checked if the Boolean variable Match equalled true or false.

The program will check if UserChoice(1) and UserChoice(2) equal.

In this case Match was set to false because the Card numbers did not match.

17.5 Started the program again and looked for two equal cards during

The program will play the match sound (unless the

In this case two Kings were clicked. The match sound played, one was added to

30 | P a g eAlan Fordyce

the 7 seconds the cards were shown. Clicked on these two cards.

mute button has been pressed) and add one to Matches. The matched cards will be hidden. One will be added to tries.

the number of matches which became 1, one was added to tries which became 1 and the Matched cards were hidden.

17.5 Started the Program then clicked the first two cards after the cards were hidden. Cards on the same line should not match with each other.

The program will play the No Match sound. One will be added to tries. The cards Imageboxes will be hidden and the back Imageboxes shown.

The match sound played, Matches stayed at 0, one was added to tries which became 1. The cards were hidden and the back images were shown.

18 Attempted to click on 6 cards instead of 2.

The program will display a message telling the user to play the game properly and will not register and matches.

A message appeared instruction me to play the game properly however, 4 of the clicked cards were shown.

19 During implementation a procedure was included to allow me to set some of the variables. These variables are: Minutes, Seconds and tries. Matches can be set to 26. Using this the Minutes was set to 99 and I waited for the minute.

The program will display a message saying the player has lost and allowing them to restart.

The program displayed a message saying time ran out. Clicking the OK button closed the Game Board and showed the Main Menu.

20 During implementation a procedure was included to allow me to set some of the variables. These variables are: Minutes, Seconds and tries. Matches can be set to 26. Using this the amount of Tries was set to 99 then I clicked on two cards to increase the amount of Tries.

The program will display a message saying the player has lost and allowing them to restart.

The program displayed a message saying that it had taken me too many tries to win. Clicking the OK button closed the Game Board and showed the Main Menu.

21 Using the procedure that was included during implementation, Matches was set to 26. During the Testing of the finished game I will attempt to get 26 Matches while playing properly.

The program will play the win sound. All the card Images will be changed to Win Images and shown. The program will display the Users score. The program

The win sound played, all card images were changed to the Win images, the program displayed a message telling me my score and then asked if I wanted to View the High Scores.

31 | P a g eAlan Fordyce

will ask the User if they want to view the High Scores.

21.5 Set Matches to 26 then clicked the View High Scores button.

The Game Board will disappear and the High Scores window will display.

The Game Board closed and the High Scores Window opened.

21.5 Set Matches to 26 then clicked no to view the High Scores.

The Game Board will disappear and the Main Menu will show.

The Game Board Closed and the Main Menu Opened.

Bugs and Errors Corrected Changed the Unloading Code to fix the problem where the Main Menu would show (and stay)

before the program asked the user if they wanted to leave the game board. Attempted to fix the audio problem but discovered that the MMControl did not have any way to

mute the Audio. The MMControl could have been changed to another Component but I decided to remove the sound functionality. Removing the sound functionality also adds the benefit of allowing the program to run on Computers that do not have Visual basic installed and lowering the Memory requirements.

Testing of Finished GameAfter the program was tested using the Test Data the whole program was ran from start to finish multiple times. This was to ensure that a player would be able to play through a whole game and even play multiple games. After the program was tested by the programmer it was given as an executable to several family members, class members and friends. These computer users range from Novice to expert. They were asked to fill out the following questionnaire.

Problems Encountered by the programmer: Not entering a Name into the Name Input box when starting the program would allow the player to

continue without a name. Starting a new game after playing or winning a game would retain the score from the last game. One card was left at the end of the game, all matches were made and the game continued.

Bugs and Errors Corrected Fixed the program continuing if a Name was not supplied. Fixed the program retaining scores when starting a new game.

Concentration Card Game Testing Questionnaire.Play the game and rate the following aspects.One Star being the Worst and five stars being the Best.Insert a Tick or Cross into the boxes based on your rating.

Ease of Use.Friendly User Interface.Difficulty of the Game.Help features available e.g. How to Play, Rules etc.

32 | P a g eAlan Fordyce

Enjoyable.Compared to playing this game with real cards how easier is it to play the computer version?Did you find any bugs or encounter any errors?If so Please describe them.

Any areas that could be improved?

Any other comments about the game?

FeedbackAmount of testers: 6.

Concentration Card Game Testing Questionnaire.The amount stars were added up and shown below.Comments that were left have been added to the spaces below.

Ease of Use. 4.5 AverageFriendly User Interface. 4.2 AverageDifficulty of the Game. 2.7 AverageHelp features available e.g. How to Play, Rules etc. 4.2 AverageEnjoyable. 4 AverageCompared to playing this game with real cards how easier is it to play the computer version?

4.5 Average

Errors Encountered. Two Testers encountered file access errors, Error Number 75 and 52.Two Testers reported that the High Score Table would not keep your second score.Two Testers reported that Cards were left over that could not be matched; one tester encountered this after quickly clicking multiple cards.

Areas that could be improved.

Increase the Amount of Tries.Increase the time the cards are shown at the start.More colourful User Interface.The speed at which the cards are displayed when clicked.

Changes or fixes made based on Feedback Increased the amount of time the cards are shown at the start from 7 to 10.

33 | P a g eAlan Fordyce

Increased the amount of time the clicked cards are shown from 1.5 seconds to 1.8 seconds. Fixed the High Score Table not keeping a second score. This bug would not have allowed any scores

after the first score to be saved.

Changes or fixes that could be made based on FeedbackDue to the timescale of this project the following changes will be omitted because of the amount of time they will take to implement. A simpler change may be implemented if it is available.

Increasing the amount of tries would require a rewrite of several areas of the program that use the High Scores. A simple change to this has been implemented. Since the High Scores are based on time when a player goes above 99 tries the value can be set to a constant 99.

Changes or fixes that cannot be made I believe the Error Number 52 and 75 can be tracked down to the Tester missing files or because of

the network restrictions in the school.

34 | P a g eAlan Fordyce

User Guide

Basic Information and FeaturesConcentration is a card game in which all of the cards are laid face down on a surface and two cards are flipped face up over each turn. The object of the game is to turn over pairs of matching cards until all the cards have been matched. This game is a computerised version which aims to save you time over playing the game with real cards. Playing the game with real cards can be done with one or two players but this Computerised version only allows for one player. The computerised version offers the following features:

Less time consuming over playing with real cards. Your score is saved and can be used as a target for you to beat or for competition with other

players. Easy to use game which allows beginner computer users to play without any trouble. You can view your current play time, tries and matches while you play, no need to remember this

yourself. The game can be run on most Windows Computer systems. Colourful and attractive card design. More…

User InterfaceThe game uses a Graphical User Interface. This allows even the most inexperienced Computer users to easily start playing.

Getting Started

Launching the GameTo start the game you will need to double click on the executable named ‘Matching Card Game’. This executable can be found in the same directory as this User Guide and has a small Icon which looks like:

Main MenuAfter being asked to use your Windows Account Name or enter one manually you will be presented with the Main Menu. From here you can Start the Game, view the How to Play information, view the Rules and view the High Scores. The buttons are located at the bottom of the screen and can be clicked with the left mouse button.

35 | P a g eAlan Fordyce

How to PlayThe How to Play screen should be your first stop before playing the game. This screen will give you the required information to begin playing the game using a step by step approach. These steps are also listed below:

1. Click the Begin Current Game button which is located at the top of the Game Board.2. The cards will appear for ten seconds and your goal is to try and memorise as many of the cards as you

possibly can before the time runs out. The remaining time can be found at the bottom right of the Game Board.

3. Once the cards turn over you will be presented with 52 Back Images. The back images represent the location of the cards. Click on an image to pick your first card. Then click on a second image to pick your second card and check for a match.

4. Repeat step 3 until you have made all 26 matches. You will know this because the game will display a message stating you have won. This message will also include your score.

36 | P a g eAlan Fordyce

Game RulesMuch like every game Concentration has several rules which must be followed. These rules allow for a more fun and competitive experience. The rules of the game are as follows:

1. Only two cards can be picked in one try2. The picked cards must be of the same rank, colour does not matter, to gain a match3. The game should only be played with one player4. The player has to successfully match 26 cards to complete the game5. The cards will be turned over and one added to the amount of tries if the match is unsuccessful

37 | P a g eAlan Fordyce

High ScoresThe game is capable of storing your score. Your score consists of your name, time and the amount of tries it took you to get all matches. The scores are sorted in descending order, this means that the best score is at the top and the worst score is located at the bottom. As you can see below the game gives you your position in the table to the left and your details to the right.

38 | P a g eAlan Fordyce

Playing the GameThe game can be started by clicking the ‘Start the game’ button which is the leftmost button on the Main Menu. The Main Menu will close and the Game Board will appear. You will see a large space in the middle of the Game board; this is where the cards will be shown.

Once you are ready click the ‘Begin the Current Game’ button to show the cards. The cards will appear and you will have ten seconds to memorise as many card locations as you can. Once the time is up the cards will turn over and back images will appear.

Click one of the cards you wish to match and the card will turn over. Click on a second card to match with this one and the selected cards will either disappear if you have a match or turn over if no match has been made. The aim is to match all the 52 cards to get 26 matches which will win the game.

The game will tell you when all 26 matches have been made. It will display your time and tries and ask you if you want to view the High Scores. Clicking ‘Yes’ will open the High Scores Screen and clicking ‘No’ will show the Main Menu.

If you wish to start a new game then click on the ‘Start a New Game’ button which is located in the same position as the ‘Start the Current Game’ button. This will ask you if you wish to close the Current Game and start a new one. Clicking ‘Yes’ will send you back to the Main Menu; click the ‘Start the game’ button to begin.

You will also notice that there are two smaller buttons located to the left of the ‘Start the Current Game’ button. The ‘How to Play’ button will open the How to Play information and the ‘Rules’ button will open the Game Rules. Clicking either of these buttons does not end the game but they do not pause the game either.

39 | P a g eAlan Fordyce

You can return to the Main Menu or Exit at any time. Clicking the ‘Back to the Main Menu’ button will ask you if you want to leave your current game; click ‘Yes’ and you will be returned to the Main Menu. Clicking the ‘Exit Game’ button will ask you if you want to exit the game; click ‘Yes’ to Exit.

40 | P a g eAlan Fordyce

Technical Guide

InstallationThe game will be stored in a Compressed Zip Archive. This helps to reduce transfer time and reduce storage sizes. To install the game right click on the Compressed ‘Matching Card Game’ Archive and select ‘Extract All…’ You must be running Windows XP, Vista or 7 to extract the files. A window will appear asking you where to extract the files to. It is advised to use the default folder which will create a ‘Matching Card Game’ folder in the current directory. Make sure the option ‘Show extracted files when complete’ is selected and click ’Extract’. The folder will open and you should find the ‘Matching Card Game’ executable and a ‘Data’ folder.

If you are not running Windows XP, Vista or 7 then you can use an external, freeware program known as 7-Zip to Extract the game. Link to 7-Zip: www.7-zip.org/

System RequirementsTo play the game it is recommended that your computer meets the requirements for the Windows Operating system as well as the following requirements:

Link to Microsoft Windows 7 Requirements: http://windows.microsoft.com/en-GB/windows7/products/system-requirements

Microsoft Windows XP, Vista or 7. See the 7-Zip extraction above for earlier versions of Windows. 20 MB of free Disk Space. 16-bit or greater display with a resolution of 1024 x 720 or more.

A Computer that does not meet the requirements may still be able to play the game but help and support is not available.

TroubleshootingIf you encounter any errors or problems then please check the following:

Your Computer meets the System Requirements - Check above. The Data folder is located in the same location as the ‘Matching Card Game’ executable. All the files are located where they should be - see the file list below. You are not trying to open the game from a restricted location – try to create a file in the same

directory as the game, if it fails then move the game elsewhere and try again. The Drive the game is located on has at least 5 MB of space.

File ListUsing the directory where the ‘Matching Card Game.exe’ is located the following files should be located:

Matching Card Game.exe

Data/

Data/Rules.txt

41 | P a g eAlan Fordyce

Data/High Scores.txt This file will be created when the game is started.

Data/Images/

Data/Images/Back

Data/Images/Back/Playing_Card_Back_1.jpeg

Data/Images/Club

Data/Images/Club/Playing_card_club_#.jpeg

Where # is 1 to 13

Data/Images/Diamond

Data/Images/Diamond/Playing_card_Diamond_#.jpeg

Where # is 1 to 13

Data/Images/Heart

Data/Images/Diamond/Playing_card_Heart_#.jpeg

Where # is 1 to 13

Data/Images/Help

Data/Images/Help/Help_Card_Click.jpeg

Data/Images/Help/Help_Card_Show.jpeg

Data/Images/Help/Help_Game_Win.jpeg

Data/Images/Icon

Data/Images/Icon/48px-French_suits_Icon.ico

Data/Images/Spade

Data/Images/Spade/Playing_card_Spade_#.jpeg

Where # is 1 to 13

Data/Images/Win

Data/Images/Win/Playing_card_win_1.jpeg

42 | P a g eAlan Fordyce

EvaluationOverall my project was successful in meeting its objectives. Some features of the design were not implemented or removed at later stages but the solution fully meets its purpose and can be played from start to finish multiple times by all computer users.

Fitness for PurposeThe purpose of my project was to create an electronic Concentration game which would save time for the player over playing with real cards. My end program meets its purpose fully and allows the player to save time over playing with real cards.

User InterfaceThe User Interface of my program can be used by most computer users without any problems. The positions and styles of buttons are similar on all screens of my program which helps users find and identify what buttons do the task they need. I do believe that the interface could have been more user friendly. The colour style of my program is basic and only contains few colours which has been commented on by the testers. The green background colour was the best choice as this matches the colour on most game boards.

RobustnessThe program could use some robustness improvements. If external image files are missing or the game is being run from a restricted location then the program will display an error and in serious cases crash. This will only be a problem if a user has deleted the data folder or they do not have write/read permission to the drive they are running the game from. The program may also crash if the High Scores file is edited. If the formatting of the High Scores file is changed then the program will not be able to get or sort the High Scores causing a crash. During Testing these were the main problems encountered by the Testers.

ReliabilityTesters have reported that cards were left over at the end of the game but I and another tester have been unable to replicate this issue. This problem may exist as a rare bug for some users stopping them from completing the game. If the user clicks on a large amount of cards then the program may not register this right away. This may cause some cards to be matched. Other than these issues the program gives the correct results and can be played from start to finish as long as the user follows the rules.

PortabilityVisual Basic allows an executable to be created which can be run on Windows computers. My program executable and data can be compressed in a .zip archive using the built in Windows Zip Compression and copied to any Windows computers. The program executable and data can be decompressed and ran on any Windows Computer.

43 | P a g eAlan Fordyce

EfficiencyThe program is fairly efficient but could be improved in two areas. The first area is reading and writing to the High Scores. This code uses multiple IF statements to identify whether a 0 needs to be added/removed to/from the High Score. This could be more efficiently implemented using Case. The second area is the type of sort used to sort the High Scores. The simple sort is used which goes through all the scores regardless if they are already sorted or not.

MaintainabilityMeaningful variable names have been used in most cases along with internal commentary to identify what the variable will be used for. The program has been split up into modules with internal commentary throughout them to identify what the code does. Limited parameter passing has been used and this could be improved on. Due to my style of programming it has often been said that my code could be made smaller and still achieve the same results. This can be seen in some areas of the program but should not affect maintainability.

Image showing the declarations section of my program with Variable names and Internal Commentary.

Features of the Solution The program has an attractive background and card design. The user can exit the game at any time. The program continues until all matches have been made. The program times the player and displays this at the end. The program stores 50 user names and times.

44 | P a g eAlan Fordyce

The program is able to display the best 50 times in descending order. The program does show all the card values at the start then flip them over to start the

game. The program does allow the user to replay until they decide to quit. The program does not allow the user to search the best times for their name and display

them – this feature was not implemented due to time constraints. A simpler solution was implemented which shows the best time for the player while they are playing the game. The High Scores form allows the player to manually search through the scores.

The program does display the current time and matches while playing. The program does not allow the user to view the cards again for help – this feature was

removed after being implemented because it was breaking the program by not allowing the cards to be clicked again.

The program does have a help feature such as a walkthrough or tutorial. The program does provide feedback that is easy to understand. The program does not provide the user with audio feedback – this feature was removed

because the MMControl did not have any way to Mute the audio.

ScheduleAlthough I was originally going to follow the Gant Chart located earlier I decided to create a draft version of the program first then use this to work backwards and create the pseudocode. The pseudocode was edited and the changes were made to the program code. A project diary was created which lists when each task was carried out and how long was spent on these tasks.

Time Taken for each StageUsing the Project Diary the time taken for each stage was calculated and rounded up to the nearest hour.

Stage Time TakenAnalysis 4 Hours

The Analysis stage took an hour less than estimated

Design 5 Hours

The Design stage took an hour more than estimated.

Language Learning 0 Hour

The Language Learning stage did not take any time because of the decision to use Visual basic. This allowed the time to be used elsewhere.

Implementation 20 Hours

The implementation stage took the same amount of time as estimated.

Testing 8 Hours

45 | P a g eAlan Fordyce

The Testing stage took 3 more hours than expected. This was needed to find the required testers and fix the bugs that were found.

Documentation 3 Hours

The Documentation stage took an hour less than estimated.

Evaluation 4 Hours

The Evaluation stage has taken 4 hours which is 1 hour less than estimated.

Total Time: 44 Hours

46 | P a g eAlan Fordyce