Giter Site home page Giter Site logo

Comments (5)

jrkong avatar jrkong commented on July 23, 2024

I took a look at the code and I have an idea.

Currently coins are created and put into a list. I want to add an additional layer to this by creating a nested dictionary which uses the coin coordinates as keys and stores the coin index in the resulting nest structure (so something like `{"x coordinate"{"y coordinate" = coin index}}). Then instead of checking every coin the dictionary is referenced to check if a coin exists. If it does the coin list is accessed to update the coin's state.

If this sounds like a viable implementation I'll work on it.

from supermario.

PrajwalKrishna avatar PrajwalKrishna commented on July 23, 2024

Nice idea and seems viable you may get going with it

from supermario.

PrajwalKrishna avatar PrajwalKrishna commented on July 23, 2024

@jrkong status?

from supermario.

jrkong avatar jrkong commented on July 23, 2024

Currently debugging. I'm thinking that just using the x and y isn't viable because of a few issues:

  1. Mario's overall coordinates aren't tracked by the board, he's just identified by the board which means checking Mario's coordinates requires more checks then originally intended.
  2. The math required to calculate Mario's size from his seed coordinates will take roughly as much work as the current coin logic implementation.

Right now I'm testing moving the coin logic into the board update logic so it removes the coin at the updated location if Mario passes it using the coin dictionary I implemented.

from supermario.

PrajwalKrishna avatar PrajwalKrishna commented on July 23, 2024

Nice

from supermario.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.