Giter Club home page Giter Club logo

codecharacter-simulator-2022's Introduction

Instructions

Dependencies

  • clang-format
  • Latest C++ compiler(Clang/GCC)
  • CMake
  • Ninja
  • CCache (optional but recommended)

Setting-Up Instructions

  • pip install -r requirements.txt to download conan, cmake-format and compdb
  • For setting up the build folder, run bash setup_build.sh, this will fetch the dependencies and create a build folder.

Build Instructions

  • cd build
  • cmake -G Ninja .. . We can provide extra build flags while running this. For example to generate release build, run cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ..
  • ninja

Building inside Docker

  • make gcc-docker
  • Other steps are same as above

codecharacter-simulator-2022's People

Contributors

captainirs avatar dipeshkaphle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codecharacter-simulator-2022's Issues

Implement game class functions

For initial version, we use a turn-based approach, something like:

  1. Attacker loop:
  • Find closest defender:
    • If in range, attack
    • If not in range, set target and move
  1. Defense loop:
  • Find closest attacker
    • If in range, attack

State should be immutable between loops.

Implement logger module

  • Create a singleton class for logger.
  • Create helper macros to be used in other classes.

Reference: Singleton pattern

Log format:

INIT
TOWERS, n, (id, typeId, x, y, hp), (id, typeId, x, y, hp), …

TURN, t
MOVE, id, x, y
SHOOT, id, id, targetNewHp
SPAWN, id, typeId, x, y, hp
DEAD, id
PRINT, log
DESTRUCTION, %
COINS, c

END
ERRORS, …

Implement main.cpp

Inputs:

  • First turn

    • First line: 2 integers: m, n
    • Next m lines, n columns each: 2d map
    • Next line: no. of turns, no. of coins
    • Next line: t - no. of troop types
    • Next t lines
      Troop type ID, HP, speed, attacking power, price
    • Next line: t1 - no. of tower types
    • Next t1 lines
      Tower type ID, HP, range, attacking power
  • Other turns:

    • First line: No. of troops (t)
    • Next t lines: (tid, x, y) positions

Outputs:

  • First line - Number of active troops (t)
  • Next t lines: (x, y, tid, HP of troop)
  • No. of active defense (d)
  • Next d lines (x, y, HP of the defense)
  • Next line: c (no. of coins remaining)

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.