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

adding chapter 11 (snake game) #555

Merged
merged 5 commits into from
Feb 5, 2024
Merged

adding chapter 11 (snake game) #555

merged 5 commits into from
Feb 5, 2024

Conversation

bunburya
Copy link
Contributor

@bunburya bunburya commented Jan 28, 2024

Adding a chapter on building a basic snake game, as discussed in #552.
Closes #552

@bunburya bunburya requested a review from a team as a code owner January 28, 2024 15:38
Copy link
Member

@eldruin eldruin left a comment

Choose a reason for hiding this comment

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

Great work! Also in line with the tone of the rest of the book. Nicely split as well.
Thank you!
I have just added a couple of formatting improvements.
Could you look at the error in CI?

microbit/src/11-snake-game/controls.md Outdated Show resolved Hide resolved
static TURN: Mutex<RefCell<Turn>> = Mutex::new(RefCell::new(Turn::None));
```

The data is wrapped in a `RefCell` to permit interior mutability and a `cortex_m::interrupt::Mutex` to allow safe access.
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a link here to the docs of RefCell?

microbit/src/11-snake-game/controls.md Outdated Show resolved Hide resolved
microbit/src/11-snake-game/controls.md Outdated Show resolved Hide resolved
microbit/src/11-snake-game/controls.md Outdated Show resolved Hide resolved
microbit/src/11-snake-game/controls.md Outdated Show resolved Hide resolved
@bunburya
Copy link
Contributor Author

Thank you - happy with your changes of course. CI is failing on cargo doc --features v1 --target thumbv6m-none-eabi, presumably because the Cargo.toml includes microbit-v2 (and not behind a v2 feature flag as the other chapters do). I will try and fix the Cargo.toml so it doesn't fail (though in practice the code in chapter 11 isn't supported for the v1 yet).

I will update the PR when I get a chance (may take a few days)

@bunburya bunburya requested a review from eldruin February 5, 2024 17:38
Copy link
Member

@eldruin eldruin left a comment

Choose a reason for hiding this comment

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

Awesome work, thank you so much!

@eldruin eldruin added this pull request to the merge queue Feb 5, 2024
Merged via the queue into rust-embedded:master with commit 9fce2cd Feb 5, 2024
17 checks passed
@bunburya bunburya deleted the snake-game branch February 5, 2024 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Additional content - snake game
2 participants