•
What should the program look like when it first starts up? i.e. what is the very first thing the user sees on the screen?
•
What thing(s) should the user expect to input when they're at the first screen?
•
Afterwards, what will the program look like? Are there different possible outcomes? What should the user input next?
•
What happens when the user types something in incorrectly?
•
Will the program display a 'board'? What will that look like? Will you be using different symbols and/or colours to represent different things on the screen? What symbols/colours? what will they represent? Will users see messages appear? if so, where?
•
What inputs/commands will the user(s) type in order to play the game? What are the valid and invalid commands/inputs?
•
What happens when a user puts down a piece?
•
What constitutes a valid or invalid move?
•
When does a player move / which player goes first?
•
What happens if a player can't move?
•
How does a player win/lose?
•
What are the draw/stalemate conditions?
•
Don't write long monolithic functions with tonnes of complex, nested loops and "if" statement all mashed up like a big ball of mud.
•
If you find yourself using loads of big, complex boolean statements then split them up.
•
Avoid copy-pasta code which repeat the same logic with different data - Try generalising repeated code into small, re-usable functions. -- Don't Repeat Yourself - https://en.wikipedia.org/wiki/Don%27t_repeat_yourself
•
Avoid using "global variables" (public static variables) because those lead to "spaghetti" logic -- global variables and private class variables are easier to follow.
Player currentPlayer = game.GetNextPlayerTurn();
screen.PromptForMove(currentPlayer);
Move move = commandLine.ReadMove(currentPlayer);
Board board = game.GetLatestBoard();
bool isMoveValid = board.CheckValid(move);
if (isMoveValid)
{
game.UpdateBoard(move);
board = game.GetLatestBoard();
screen.Redraw(board);
}
Last reply 1 minute ago
Amazon Project management apprenticeship 2024Last reply 1 minute ago
Edexcel GCSE Geography A Paper 1 (1GA0/01) - 17th May 2024 [Exam Chat]Last reply 1 minute ago
Customer Services Group - Operational Delivery - Administrative OfficersLast reply 2 minutes ago
Official Cambridge Postgraduate Applicants 2024 ThreadLast reply 2 minutes ago
AQA GCSE Physics Paper 1 (Higher Tier triple) 8463/1H - 22nd May 2024 [Exam Chat]Last reply 3 minutes ago
How to Write an A* Prose Essay (A-level English Lit)Last reply 4 minutes ago
Religion Politics and Society at King's College?Last reply 6 minutes ago
Woodhouse College applicants 2024Last reply 6 minutes ago
Is anyone else more aroused/turned on when having to pee really badly?Last reply 9 minutes ago
HSBC Degree Apprenticeship 2024Last reply 9 minutes ago
LSE International Social and Public Policy and Economics (LLK1) 2024 ThreadLast reply 13 minutes ago
Official University of Edinburgh Applicant Thread for 2024Last reply 15 minutes ago
JK Rowling in ‘arrest me’ challenge over hate crime lawLast reply 16 minutes ago
Official Glasgow Caledonian University Applicant Thread for 2024Last reply 1 week ago
OCR A-level Computer Science Paper 2 (H446/02) - 19th June 2023 [Exam Chat]Last reply 2 weeks ago
AQA A-level Computer Science Paper 1 (7517 1A - 1E) - 12th June 2023 [Exam Chat]Last reply 3 weeks ago
OCR A-level Computer Science Paper 1 (H446/01) - 12th June 2023 [Exam Chat]Last reply 2 months ago
OCR GCSE Computer Science Paper 1 (J277/01) - 19th May 2023 [Exam Chat]Last reply 3 months ago
AQA GCSE Computer Science Paper 2 (8525/2) - 25th May 2023 [Exam Chat]Last reply 5 months ago
AQA GCSE Computer Science Paper 1 (8525/1A, 1B, 1C) - 19th May 2023 [Exam Chat]Last reply 5 months ago
AQA Computer Science NEA and Computer science paper 1 questionLast reply 1 week ago
OCR A-level Computer Science Paper 2 (H446/02) - 19th June 2023 [Exam Chat]Last reply 2 weeks ago
AQA A-level Computer Science Paper 1 (7517 1A - 1E) - 12th June 2023 [Exam Chat]Last reply 3 weeks ago
OCR A-level Computer Science Paper 1 (H446/01) - 12th June 2023 [Exam Chat]Last reply 2 months ago
OCR GCSE Computer Science Paper 1 (J277/01) - 19th May 2023 [Exam Chat]Last reply 3 months ago
AQA GCSE Computer Science Paper 2 (8525/2) - 25th May 2023 [Exam Chat]Last reply 5 months ago
AQA GCSE Computer Science Paper 1 (8525/1A, 1B, 1C) - 19th May 2023 [Exam Chat]Last reply 5 months ago
AQA Computer Science NEA and Computer science paper 1 question