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

Make move() function dynamic #202

Open
0xibs opened this issue Feb 6, 2025 · 14 comments
Open

Make move() function dynamic #202

0xibs opened this issue Feb 6, 2025 · 14 comments
Assignees
Labels

Comments

@0xibs
Copy link
Collaborator

0xibs commented Feb 6, 2025

  • The move() function is located in game_actions.cairo.
  • Currently, when the the move() function is executed, it determines which player position it should move using the sequence: R => G => Y => B. This enforces the first player of the game to be Red (R), which is problematic because players can choose any color when joining the game, and also any player can start the game.

Expectations

  • The move() function should take into account the player that makes the call, and use the player's username to determine the move to make.
  • Update the test cases related to the move() function to reflect the changes made.
  • (You can either accept the player's username as argument into the move() function or extract the username using the get_username_from_address() utility function. You can get the address using the get_caller_address() function.

ETA: 2 days

@0xibs 0xibs added the onchain label Feb 6, 2025
@Jagadeeshftw
Copy link
Contributor

I'd like to work on this task. ETA 2 days.

@No-bodyq
Copy link

No-bodyq commented Feb 6, 2025

Can I work on this please @0xibs

@FrankiePower
Copy link

Hello

My name is SuperFranky. I am an OD diamond contributor, frontend and blockchain developer with over 3+ years of experience and have contributed to a variety of interesting projects in the Web3 space. My expertise in React, Next.js, Solidity, Cairo, responsive design, and an array of other programming languages makes me confident in delivering high-quality solutions.

I'd love to tackle this issue.

@emarc99
Copy link
Contributor

emarc99 commented Feb 6, 2025

@Jagadeeshftw is sozo test working perfectly on your end?

@Jagadeeshftw
Copy link
Contributor

Yes @emarc99, make sure you followed the prerequisites mentioned in README.md

Image

@0xibs
Copy link
Collaborator Author

0xibs commented Feb 6, 2025

Yes @emarc99, make sure you followed the prerequisites mentioned in README.md

Image

@Jagadeeshftw just to confirm, are you running the latest code in dev?

@Jagadeeshftw
Copy link
Contributor

In the latest code, it seems to be not compiling @0xibs

@0xibs
Copy link
Collaborator Author

0xibs commented Feb 6, 2025

dev branch has been synced to the latest code

@0xibs
Copy link
Collaborator Author

0xibs commented Feb 6, 2025

@Jagadeeshftw try pulling from dev again

@emarc99
Copy link
Contributor

emarc99 commented Feb 6, 2025

Not compiling still. Seems less errors than before.

@0xibs
Copy link
Collaborator Author

0xibs commented Feb 6, 2025

Can you debug the error? I think it should be related to a misplaced comma or semi-colon or something similar in the models

@emarc99
Copy link
Contributor

emarc99 commented Feb 6, 2025

Yes, I have noticed misplaced curly brackets as well. Didn't want to break something without permission.
Will debug from my end.

@Jagadeeshftw
Copy link
Contributor

@0xibs I have fixed those errors, shall i push my changes?

@0xibs
Copy link
Collaborator Author

0xibs commented Feb 6, 2025

@0xibs I have fixed those errors, shall i push my changes?

Sure 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants