Skip to content

Conversation

jimmytty
Copy link
Contributor

@jimmytty jimmytty commented Sep 5, 2025

  • difficulty set to 8.
  • .input.hands and .expected mapped to TEXT -- json array.
  • added the file instructions.append.md.

@IsaacG IsaacG added x:action/create Work on something from scratch x:module/practice-exercise Work on Practice Exercises x:rep/large Large amount of reputation x:size/large Large amount of work labels Sep 5, 2025

INSERT INTO tests (uuid, description, hands, expected)
VALUES
('161f485e-39c2-4012-84cf-bec0c755b66c', 'single hand always wins', '["4S 5S 7H 8D JC"]', '["4S 5S 7H 8D JC"]'),
Copy link
Member

Choose a reason for hiding this comment

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

If we're using structured data, would a nested array make sense here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤔 Would it be better to concatenate the hands using line breaks? For example, instead of

["4D 5S 6S 8D 3C", "2S 4C 7S 9H 10H", "3S 4S 5D 6H JH", "3H 4H 5C 6C JD"]

we should use:

4D 5S 6S 8D 3C
2S 4C 7S 9H 10H
3S 4S 5D 6H JH
3H 4H 5C 6C JD

?

Copy link
Member

Choose a reason for hiding this comment

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

I generally prefer providing the data in the easiest-to-use format to make the exercise about the actual exercise and not string parsing, as much as possible.

Whichever you think is the easiest to use?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤔 In json format, the data is already parsed (or nearly so). When we provide multiples elements/rows in a text format separated by newlines (or other separator) it's needed first to pre-parse the data in a suitable way.

Anyway , this exercise is hard and we could provide data separated by newlines and not "suggest" people to use json, this could be a more free way to solve the exercise.

JSON is something "new" to databases and I think many people are not familiarized with it. For these people, json can be harder than a simple text format. In this exercise, my code will grow a bit to parse the strings but nothing really laborous.

😁 I'd rather let you decide.

Copy link
Member

Choose a reason for hiding this comment

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

JSON is something "new" to databases and I think many people are not familiarized with it. For these people, json can be harder than a simple text format.

Let's assume anyone solving Poker in SQLite has already solved the various other JSON-based exercises and figured out how to use the JSON functions, ie that JSON functions are not hard for people solving this exercise.

In this exercise, my code will grow a bit to parse the strings but nothing really laborous.

I want the input that shrinks the code :)

Anyway , this exercise is hard and we could provide data separated by newlines and not "suggest" people to use json, this could be a more free way to solve the exercise.

The Poker part is hard. I won't want to make the text part any harder than it needs to be. I want to make the parsing as easy as possible.

I think a preformatted list-of-lists would better here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To use in the actual architecture of one column for input and one for output, I think json is better, but for a more sql approach relationships would be a improved approach, primary keys and foreign keys, even I don't know for sure a good way to show and/or explain this to people that will do the exercises 🤭

[Off Topic]: I have "created" a way to solve the reverse string and other byte-to-byte string manipulations without use recursive cte and the exercise of the reverse string would be medium. When I search in google about, all answers where the same: "use recursive cte", so I didn't try another approach... my bad.

Copy link
Member

Choose a reason for hiding this comment

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

To use in the actual architecture of one column for input and one for output, I think json is better, but for a more sql approach relationships would be a improved approach, primary keys and foreign keys, even I don't know for sure a good way to show and/or explain this to people that will do the exercises 🤭

Alright. We can leave it as is.

[Off Topic]: I have "created" a way to solve the reverse string and other byte-to-byte string manipulations without use recursive cte and the exercise of the reverse string would be medium. When I search in google about, all answers where the same: "use recursive cte", so I didn't try another approach... my bad.

The difficulty doesn't have to reflect the simplest approach. It's a very subjective measure that roughly aligns the student's expectation. Some students struggle with concepts that others find easy and find easy concepts that others find challenging. No difficulty will ever apply universally. It's a very rough estimate that sets rough expectations.

@IsaacG IsaacG changed the title * add practice exercise: poker Add practice exercise: poker Sep 5, 2025
@IsaacG IsaacG merged commit aac949a into exercism:main Sep 7, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x:action/create Work on something from scratch x:module/practice-exercise Work on Practice Exercises x:rep/large Large amount of reputation x:size/large Large amount of work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants