Code Monkey home page Code Monkey logo

dynamic_sunburst_game's Introduction

You can (1) change the variable 'depth' in luoji.js file to set the levels of the tree.

How to play with the game?

1、You can open the sunbrust.html with a broswer to start the game.

2、This is a two player game, one is red Player, the other is blue player.

3、What are the rules of this game?

3.1 Both players can only click the leaf nodes(Outermost node) in this full binary tree.

3.2 At the beginning of the game, a round should be performed like this way: the red player click a leaf node first, then the blue player chooses a suitable left node( What's sutiable node? It means the node's color is drak green). Then we can start a new round.

3.3 In each round, the red player can only choose the leaf node whose color is light blue(single label) or light purple(the node has two labels), and the blue player can only choose the leaf node whose color is drak green.

3.4 In the dynamic version, the red player should follow a 3-ouf-of-4 rule, so during the gameing process, some area will become gray, so the gray area is forbidden for the red player.

3.5 For every choice of the red player, the blue player should choose a suitable choice.( of course, in this game , the suitable or legit positions will be highlighted before the blue player to do his decision.) IF the red player chooses a double-labeled node, the blue player should choose two suitable nodes to deal with that.

3.6 If anyone wants to be able to step back, he can click the undo button.

4、How to judge who wins the game?

If there is no highlighted drak green node for blue player to choose, it means the blue player loses the game.) If the red player has no more light blue nodes to choose, it means the red player loses the game.

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.