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

Create an evolution PoC model #91

Closed
coxmars opened this issue Nov 20, 2024 · 10 comments · Fixed by #97
Closed

Create an evolution PoC model #91

coxmars opened this issue Nov 20, 2024 · 10 comments · Fixed by #97
Assignees
Labels
external-contributor Available for external contributors good first issue Good for newcomers ODHack10

Comments

@coxmars
Copy link
Contributor

coxmars commented Nov 20, 2024

Create an evolution.cairo PoC model to manage creature evolutions based on pre-defined constants or rules.

You can think about these fields, feel free to change, delete, or modify them according to our current backend structure:

  • base_beast_id: Unique ID of the base beast.
  • evolved_beast_id: Unique ID of the evolved beast.
  • level_requirement: Minimum level required for the evolution.
  • required_battles: Number of battles the beast must win to evolve.
  • required_item: ID of an item required for the evolution (optional).

Feel free to implement the following core functions:

  • can_evolve: Check if a creature meets the requirements to evolve.
  • evolve: Perform the evolution process and return the evolved creature ID if successful.

The evolution rules should be defined as constants for now, allowing the backend to manage evolution conditions without dynamic changes. For example something like this but in Cairo:

const EVOLUTION_RULES = {
    1: {"evolved_beast_id": 2, "level_requirement": 10, "required_battles": 5, "required_item": 1001},
    2: {"evolved_beast_id": 3, "level_requirement": 20, "required_battles": 10, "required_item": None},
};

If you need help just ask me here in a comment or ping me on Telegram in the group channel for external contributors.

Thanks for your time, please send a comment with your approach/solution, be creative and use a technical explanation and avoid ChatGPT or AI comments.

@Bosun-Josh121
Copy link
Contributor

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged:

software engineering background, backend & smart contract dev with contribution to similar tasks(https://app.onlydust.com/u/Josh-121) looking to make first contribution on this project

How I plan on tackling this issue
I have good understanding of this & woud create ,
work on feedback & recommendation ensuring contact. Can deliver within a day upon assignment

@Josue19-08
Copy link

Hi, I'm Josué, and I'm part of the Dojo Coding community. I have experience in programming languages such as Angular, React, C#, .NET, C++, PHP, Python, Java, Node.js, and JavaScript, among others. I'm passionate about software development and enjoy contributing to open-source projects, applying my knowledge to solve problems in a practical way.

I would create an Evolution.Cairo file with fixed evolution rules saying what it takes for a creature to evolve. I would then do a can_evolve function to check if it meets the requirements and another evolve function that changes the creature to the new ID if everything is ok. This way it is handled easily and clearly according to the rules we have.

@Kom02
Copy link

Kom02 commented Nov 21, 2024

Hi, My name is Kevin Obando, a full stack junior developer with 2 years of experience from Costa Rica. I am starting in this community and I want to help in this project.

@RJMadrigal
Copy link

RJMadrigal commented Nov 21, 2024

Hi team!

I would like to get this opportunity. I am a systems engineer from Costa Rica, with experience in C#, and I am currently learning Cairo and Rust, which makes this project a great opportunity to apply and strengthen my knowledge.

It's my first ODhack and I'm looking for my first contribution, so I'm excited to contribute and learn in this collaborative environment. I commit to implementing the evolution PoC model with the necessary attributes, developing the can_evolve and evolve function, and ensuring that full testing is performed to validate its proper functioning.

Thank you for considering me!

@jsanchez556
Copy link
Contributor

Hi, my name is José Mario from Costa Rica, a Full stack developer with more than 15 years in development and a focus in TypeScript, JavaScript, Nodejs and React. Open Source projects are something I enjoy, and I am now learning on Rust, and Cairo, I recently contribute to some Rust projects. About my learning and growth in the industry, I started doing ODHacks as early as version 7.0 due to my work with Dojo Coding. I am excited to utilize my wealth of experience and experience to new technologies to meet new challenges and deliver results.

How to tackle this feature:

Create a new Cairo file that contain two functions:

can_evolve -> Check a beast against the requirements based on the evolution rules defined

evolve -> If the requirements are satisfied perform the evolution

Finally create unit tests in order to validate that the functionality meets the expectations.

@Joewizy
Copy link

Joewizy commented Nov 21, 2024

May I pick this up?

Would implement this project firstly by defining the structure of the BEAST defining is elements like id, evolution, level, battles_won etc.

Create the evolve and can_evolve function making sure they check necessary conditions like the beast's level, the battles won, and any items required—before allowing the evolution to happen.

And most importantly I’ll focus on testing everything thoroughly. I’ll write unit tests to make sure the creatures evolve as expected, and I’ll also check for edge cases, like creatures that don’t exist or ones that have met some of the requirements but not all of them.

@ShantelPeters
Copy link

May I pick this up?

@Michaelkingsdev
Copy link

I’d like to resolve this.

@coxmars
Copy link
Contributor Author

coxmars commented Nov 21, 2024

Hi, my name is José Mario from Costa Rica, a Full stack developer with more than 15 years in development and a focus in TypeScript, JavaScript, Nodejs and React. Open Source projects are something I enjoy, and I am now learning on Rust, and Cairo, I recently contribute to some Rust projects. About my learning and growth in the industry, I started doing ODHacks as early as version 7.0 due to my work with Dojo Coding. I am excited to utilize my wealth of experience and experience to new technologies to meet new challenges and deliver results.

How to tackle this feature:

Create a new Cairo file that contain two functions:

can_evolve -> Check a beast against the requirements based on the evolution rules defined

evolve -> If the requirements are satisfied perform the evolution

Finally create unit tests in order to validate that the functionality meets the expectations.

Hi @jsanchez556, be focused on the implementation of the model/functions in a deeply way, we have another issue for the unit test and if you need help just ask me 🫡

@jsanchez556
Copy link
Contributor

Hi, my name is José Mario from Costa Rica, a Full stack developer with more than 15 years in development and a focus in TypeScript, JavaScript, Nodejs and React. Open Source projects are something I enjoy, and I am now learning on Rust, and Cairo, I recently contribute to some Rust projects. About my learning and growth in the industry, I started doing ODHacks as early as version 7.0 due to my work with Dojo Coding. I am excited to utilize my wealth of experience and experience to new technologies to meet new challenges and deliver results.
How to tackle this feature:
Create a new Cairo file that contain two functions:
can_evolve -> Check a beast against the requirements based on the evolution rules defined
evolve -> If the requirements are satisfied perform the evolution
Finally create unit tests in order to validate that the functionality meets the expectations.

Hi @jsanchez556, be focused on the implementation of the model/functions in a deeply way, we have another issue for the unit test and if you need help just ask me 🫡

Hi @coxmars, got it, i’ll focus on the implementation.

Thank you for the opportunity!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external-contributor Available for external contributors good first issue Good for newcomers ODHack10
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

9 participants