Giter Site home page Giter Site logo

ts-dynamite's Introduction

TypeScript Dynamite

Background

You are probably familiar with the game Rock-Paper-Scissors. This variant adds two new elements - Dynamite and Water Balloon. The full rules can be found at https://dynamite.softwire.com.

Your Task

Your job is to build an agent and pit it against your fellow interns (as well as a few other simple bots that I'll add into the mix)!

It's possible to get something working very quickly - there are already a few very simple bots in this repo - but the possibilities for making your agent more sophisticated and complex are endless!

Getting Started

  1. Read the rules at https://dynamite.softwire.com.
  2. Fork this repo and open it in VS Code
  3. Install the dependencies with npm install
  4. Check that everything is working ok.

Powershell:

.\battle.ps1 rockBot paperBot

Bash:

sh battle.sh rockBot paperBot

You should see the following output with no error messages:

Game 1 results:
Winner: p2
Score: 0 - 1000
Reason: score
  1. Write your own bot! You can add a new bot in the src/bots/ directory.

Testing Your Bot Locally

You can run your bot(s) against any other bot you have locally using the following command:

Powershell:

.\battle.ps1 playerOneBot playerTwoBot

Bash:

sh battle.sh playerOneBot playerTwoBot

Testing Your Bot Remotely

You can upload your bot to https://dynamite.softwire.com to play against bots that other people have previosuly created.

Important: you will need to upload the transpiled JavaScript file for your bot, not the TypeScript file that you developed. This can be found at dist/bots/botName.js after running npm run convert.

Tournament Ready

Towards the end of this exercise, I will create a tournament for everyone's bots (and a few additional simple bots of my own). You will be able to enter you bot into the tournament on the Dynamite website.

A few notes to make this as fun as possible:

  • Make sure you count your dynamite! There is nothing worse than losing a game at the last minute by attempting to use too much.
  • The same instance of your class is used for all rounds of a match, so you can store any state you wish to keep track of independently of the Gamestate.
  • Stay in the spirit of the game - e.g. don't try and use reflection to interfere with the game runner or opposing bots.

ts-dynamite's People

Contributors

cameronmccormack avatar sambutlersoftwire avatar

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.