hint button implementation added to project command#19
Merged
ebcq merged 4 commits intocppdiscord:mainfrom Jan 19, 2025
Merged
Conversation
ebcq
requested changes
Jan 14, 2025
Contributor
ebcq
left a comment
There was a problem hiding this comment.
Thank you @mbn-code! Just a few ideas for improvement:
- Replace the tabs with spaces (since we use spaces everywhere else)
- Put the hints in the same file (
project.txt) instead of creating a new filehints.txtfor less confusion - Refer to resources in the hints (e.g. cppreference)
I can think of two possible solutions.
1. CSV
"Print `Hello, World!` to the screen.";"Use the [std::cout](https://en.cppreference.com/w/cpp/io/cout) stream to print text to the console."
2. JSON (if we want more separated information)
{
"title": "Hello World!",
"description": "Print `Hello, World!` to the screen.",
"hint": "Use the [std::cout](https://en.cppreference.com/w/cpp/io/cout) stream to print text to the console.",
"level": "Beginner"
}
What are your thoughts on these ideas?
src/commands/project_cmd.cpp
Outdated
| { | ||
| static int index; | ||
| const std::string project = cmd::utils::readFileLine("res/project.txt", index); | ||
| static int index; |
hint button remade to support json file with project idea and hint.
ebcq
approved these changes
Jan 19, 2025
Contributor
ebcq
left a comment
There was a problem hiding this comment.
Your code had a few problems that I fixed, so please take a look at my changes. Everything else looked fine to me :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request includes enhancements to the
projectCommandfunction insrc/commands/project_cmd.cppand adds new hints to thesrc/res/hints.txtfile. The most important changes include adding a button to display hints and handling button click events.Enhancements to
projectCommandfunction:buttonClickedto track the button click state.res/hints.txtand prevent multiple clicks.Addition of new hints:
src/res/hints.txtfile for use in the hint button feature.