Giter Club home page Giter Club logo

pig_bots's Introduction

pig_bots

Write code for an AI to play the dice game of "Pig".

All pig bots will play against each other in an epic battle royale. Will your bot be the best?

Rules

Your function should be named choice() and accept three arguments:

  • round_score - the score for the current round
  • my_score - the player's current banked score
  • opponent_score - the opponent's current banked score

The function should return a Boolean representing the choice:

  • True - roll again
  • False - stop and bank the round score

It's up to you to determine how the bot chooses what to do.

Here's a really simple example - a bot that rolls until it gets more than 12 points:

def choice(round_score, my_score, opponent_score):
    return round_score <= 12

Submitting your bot

  1. Click the "Add file" button above and choose "Create new file".
  2. In the "Name your file..." box, you must name your bot bot_<username>.py so it can be identified as belonging to you.
  3. Paste your choice() function in the box, and then click the green Propose new file button.
  4. Click the green Create pull request button to submit your bot.

You may submit up to 5 bots, just name each one with a 2, 3, 4, etc., such as bot_bradfield2.py.

pig_bots's People

Contributors

cbscribe avatar kccgames avatar nekomi0221 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.