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

feat: use chat gpt 4 to write the code #1

Merged
merged 2 commits into from Mar 25, 2023
Merged

Conversation

Markkop
Copy link
Owner

@Markkop Markkop commented Mar 25, 2023

Initial prompt:

Write me the code for a React app that helps the moderator of a Mafia/Werewolf party game to track player roles and night actions. The app will have predefined roles and will allow the user to add players to the game before starting it. The app will have a few steps available to the user:
1) Add and remove players
2) Add and remove roles. It should also specify how many of each role will be in the game.
Then the game will randomly assign the roles to the players.
From now on, it should always display a table with the players, they roles. If they are dead, their names must be striked.
3) Night actions. Now each role that has an action will be able to perform a night action. Each role will be able have its own step and its own function that will interact with the game history.
Each role will have its own function code. Mafioso will be able to choose a target to kill. Sheriff will choose a target to find out if it is good or bad. Doctor will be able to select a target and prevent the death of that target for that night. Townies won't have night action.
5) After all night action steps, all actions will be resolved and a screen with the moderator announcement will appear with a summary of what happened that night, based on the previous steps. The summary may contain texts like "Player X died." or "No one died". The action resolver will set players as dead if the mafia targeted them and the doctor didn't target them, for example.
6) After that, the new step it's the discussion and voting step. A visual timer of 5 minutes will start. The user can prematurely click on the next step button to go to the next step if he wants.
7) On this next Hanging Step, the user may or may not select a player to set as dead, as consequence of possible voting.
8) Start night 2 and start from step 3.

Do these steps every night until there are only 2 players.

These are the starting roles:
export const existingRoles: Role[] = [
  {
    name: 'Townie',
    description: 'Find and kill the evildoers in the town.',
    alignment: 'Good',
    points: '1'
  },
  {
    name: 'Sheriff',
    description: 'Each night check if a player is "Good" or "Evil".',
    alignment: 'Good',
    points: '7'
  },
  {
    name: 'Doctor',
    description: 'Each night choose a player to heal. They cannot be killed that night.',
    alignment: 'Good',
    points: '4'
  },
  {
    name: 'Mafioso',
    description: 'Each night wake with the Mafia. You vote for a player to kill.',
    alignment: 'Evil',
    points: '-6'
  },
]

You may use any library that will make the code easier to maintain and save up code. Reuse the most code you can. Don't explain me your thinking or your code, just provide code snippets with the name of each file on top. Assume that the react project is already setup. Don't style anything.

@vercel
Copy link

vercel bot commented Mar 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
werewolf-moderator-helper ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 25, 2023 at 10:57PM (UTC)

@Markkop
Copy link
Owner Author

Markkop commented Mar 25, 2023

Write the handleAction code of the NightSctions.tsx file for the existing roles. If you need to change any other file, write me the name of the file and fill with "..." the unchanged lines of code.
Don't explain me your thinking or your code, just provide code snippets with the name of each file on top. Don't style anything.

and

Complete the handleFinishNightActions code so it computes what happened that night and updates the player according to the result. 

@Markkop Markkop merged commit 3a90705 into main Mar 25, 2023
2 checks passed
@Markkop Markkop deleted the chat-gpt-4-solution branch March 25, 2023 23:01
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.

None yet

1 participant