tizkovatereza / Blackjack

3 stars 1 forks source link

Sweep: Please write a program that lets you play Blackjack card game. Write it in JS, create a new JS file for that. Thank you. #4

Open tizkovatereza opened 1 year ago

tizkovatereza commented 1 year ago
Checklist - [X] `Blackjack.js` ✅ Commit [`09c9dca`](https://github.com/tizkovatereza/Blackjack/commit/09c9dca55f224526fc86e921e7a75caaacd7f829)
• Create a new JavaScript file named "Blackjack.js". • Translate the game logic from the Python files "Blackjack_GitHub_Copilot.py" and "Blackjack_TT.py" into JavaScript. This includes creating the deck of cards, defining the card values, shuffling the deck, dealing the cards, and implementing the game loop. • Ensure to use JavaScript conventions and best practices, such as using "let" and "const" for variable declarations, and using "function" for function declarations. • Implement user input handling using JavaScript's "prompt" function for the player's decisions to hit or stand. • Implement output to the console using JavaScript's "console.log" function to display the player's and dealer's cards and scores, and the game results.
Sandbox Execution Logs
trunk init 1/3 ✓
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 11 linters were enabled (.trunk/trunk.yaml)
  bandit 1.7.5 (2 python files)
  black 23.9.1 (2 python files)
  checkov 2.4.9 (1 yaml file)
  git-diff-check (6 files)
  isort 5.12.0 (2 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  prettier 3.0.3 (1 javascript, 1 markdown, 1 yaml file)
  ruff 0.0.290 (2 python files) (created ruff.toml)
  trivy 0.45.1 (1 yaml file)
  trufflehog 3.56.1 (6 files)
  yamllint 1.32.0 (1 yaml file) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt Blackjack.js 2/3 ✓

 ✔ Formatted Blackjack.js
Re-checking autofixed files...

Checked 1 file
✔ No issues
trunk check --fix Blackjack.js 3/3 ✓

Checked 1 file
✔ No issues
- [X] `README.md` ❌ Failed
• Add a new section to the README.md file titled "JavaScript Version". • In this section, provide a brief description of the JavaScript version of the game, and instructions on how to run it.
Sandbox Execution Logs
trunk init 1/3 ✓
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 11 linters were enabled (.trunk/trunk.yaml)
  bandit 1.7.5 (2 python files)
  black 23.9.1 (2 python files)
  checkov 2.4.9 (1 yaml file)
  git-diff-check (5 files)
  isort 5.12.0 (2 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  prettier 3.0.3 (1 markdown, 1 yaml file)
  ruff 0.0.290 (2 python files) (created ruff.toml)
  trivy 0.45.1 (1 yaml file)
  trufflehog 3.56.1 (5 files)
  yamllint 1.32.0 (1 yaml file) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt README.md 2/3 ✓

 ✔ Formatted README.md
Re-checking autofixed files...

Checked 1 file
✔ No issues
trunk check --fix README.md 3/3 ✓

Checked 1 file
✔ No issues
sweep-ai[bot] commented 1 year ago

Here's the PR! https://github.com/tizkovatereza/Blackjack/pull/5.

⚡ Sweep Free Trial: I used GPT-4 to create this ticket. You have 2 GPT-4 tickets left for the month and 0 for the day. For more GPT-4 tickets, visit our payment portal.


Actions (click)


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/tizkovatereza/Blackjack/blob/295fc93ba5e0b6e1cbc236da037526a2b04ad4eb/Blackjack_GitHub_Copilot.py#L1-L57 https://github.com/tizkovatereza/Blackjack/blob/295fc93ba5e0b6e1cbc236da037526a2b04ad4eb/README.md#L1-L0 https://github.com/tizkovatereza/Blackjack/blob/295fc93ba5e0b6e1cbc236da037526a2b04ad4eb/Blackjack_TT.py#L1-L87

Step 2: ⌨️ Coding

trunk init 1/3 ✓
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 11 linters were enabled (.trunk/trunk.yaml)
  bandit 1.7.5 (2 python files)
  black 23.9.1 (2 python files)
  checkov 2.4.9 (1 yaml file)
  git-diff-check (6 files)
  isort 5.12.0 (2 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  prettier 3.0.3 (1 javascript, 1 markdown, 1 yaml file)
  ruff 0.0.290 (2 python files) (created ruff.toml)
  trivy 0.45.1 (1 yaml file)
  trufflehog 3.56.1 (6 files)
  yamllint 1.32.0 (1 yaml file) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt Blackjack.js 2/3 ✓

 ✔ Formatted Blackjack.js
Re-checking autofixed files...

Checked 1 file
✔ No issues
trunk check --fix Blackjack.js 3/3 ✓

Checked 1 file
✔ No issues

trunk init 1/3 ✓
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 11 linters were enabled (.trunk/trunk.yaml)
  bandit 1.7.5 (2 python files)
  black 23.9.1 (2 python files)
  checkov 2.4.9 (1 yaml file)
  git-diff-check (5 files)
  isort 5.12.0 (2 python files) (created .isort.cfg)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  prettier 3.0.3 (1 markdown, 1 yaml file)
  ruff 0.0.290 (2 python files) (created ruff.toml)
  trivy 0.45.1 (1 yaml file)
  trufflehog 3.56.1 (5 files)
  yamllint 1.32.0 (1 yaml file) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt README.md 2/3 ✓

 ✔ Formatted README.md
Re-checking autofixed files...

Checked 1 file
✔ No issues
trunk check --fix README.md 3/3 ✓

Checked 1 file
✔ No issues


Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/js-version.

.


🎉 Latest improvements to Sweep:


💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord