Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tic-tac-toe: Explicit the game's independence from user input #29028

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

softy-dev
Copy link
Contributor

@softy-dev softy-dev commented Oct 30, 2024

Because

Because they imagine a person playing tic-tac-toe, students usually think that they require something to take their input (prompt) for the game to work (like they did in RPS), which isn't true. I think a reminder that this isn't needed at all would be useful so that they don't have to refactor the code when they reach the DOM stage because they introduced an unneeded step earlier.

This PR

  • Adds a reminder to the project's instruction about how it's possible to test the parts of the game by passing arguments to functions instead of taking user input.

Issue

Closes #XXXXX

Additional Information

Pull Request Requirements

  • I have thoroughly read and understand The Odin Project curriculum contributing guide
  • The title of this PR follows the location of change: brief description of change format, e.g. Intro to HTML and CSS lesson: Fix link text
  • The Because section summarizes the reason for this PR
  • The This PR section has a bullet point list describing the changes in this PR
  • If this PR addresses an open issue, it is linked in the Issue section
  • If any lesson files are included in this PR, they have been previewed with the Markdown preview tool to ensure it is formatted correctly
  • If any lesson files are included in this PR, they follow the Layout Style Guide

@github-actions github-actions bot added the Content: JavaScript Involves the JavaScript course label Oct 30, 2024
@softy-dev softy-dev force-pushed the patch-2 branch 2 times, most recently from f85d1d3 to f7f2de0 Compare October 30, 2024 17:31
1. In this project, think carefully about where each bit of logic should reside. Each little piece of functionality should be able to fit in the game, player or gameboard objects. Take care to put them in “logical” places. Spending a little time brainstorming here can make your life much easier later!
1. If you’re having trouble, [Building a house from the inside out](https://www.ayweb.dev/blog/building-a-house-from-the-inside-out) is a great article that lays out a highly applicable example both of how you might approach tackling this project as well as how you might organize and structure your code.
1. Focus on getting a working game in the console first. Make sure you include logic that checks for when the game is over! You should be checking for all winning 3-in-a-rows and ties. Try to avoid thinking about the DOM and your HTML/CSS until your game is working. Don't worry about taking user input at this point either: you can pass arguments to your functions and play the game yourself to check if everything is working as intended.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Punctuation nit + wording suggestion. A sensible addition, this clarification!

Suggested change
1. Focus on getting a working game in the console first. Make sure you include logic that checks for when the game is over! You should be checking for all winning 3-in-a-rows and ties. Try to avoid thinking about the DOM and your HTML/CSS until your game is working. Don't worry about taking user input at this point either: you can pass arguments to your functions and play the game yourself to check if everything is working as intended.
1. Focus on getting a working game in the console first. Make sure you include logic that checks for when the game is over! You should be checking for all winning 3-in-a-rows and ties. Try to avoid thinking about the DOM and your HTML/CSS until your game is working. Don't worry about taking user input at this point either. You can call your functions and pass arguments to them to play the game yourself and check if everything is working as intended.

@MaoShizhong MaoShizhong merged commit dba2d44 into TheOdinProject:main Oct 30, 2024
2 checks passed
@softy-dev softy-dev deleted the patch-2 branch October 30, 2024 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content: JavaScript Involves the JavaScript course
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants