Skip to content

ShouvikGhosh2048/egui_cops_and_robbers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

egui_cop_and_robbers

Visualizer for algorithms on the game of Cops and Robbers. Currently I've implemented Random and MENACE.

Cops and Robbers - These videos are useful resources on the game of Cops and Robbers.

MENACE - These videos and this blog post are useful resources for the Menace algorithm.

Note: My MENACE implementation is a bit different -

  • We start with 50 tokens for each move.
  • We don't change any tokens in any box until the match is over. When it ends, we add 3 tokens if it's a win, else we remove 1 token.
  • If the box gets empty, we reset it to 50 tokens for each move.

App

Game selection

CopsAndRobbers1

Graph editor

CopsAndRobbers2

You can create your own graphs. Graphs require a name and at least one vertex.

Vertex mode: In the vertex mode you can create vertices by right clicking and move vertices by dragging them.

Edge mode: In the edge mode you can create edges by dragging the edge from one vertex to the other.

Delete: You can delete vertices/edges by selecting them and clicking the delete button.

You can create the graph / cancel the creation with the respective buttons.

Game

CopsAndRobbers3

The game view has two parts - the game and the statistics.

The statistics panel consists of the current cop, current robber and the graph of the cop wins.

For MENACE algorithms, we have two types of bags - start bags (first move) and non start bags.

CopsAndRobbers5

For MENACE robber bags and non start MENACE cop bags, you can change the selected bag by choosing the object to edit, and then clicking the vertex you want.

You can sort the moves in descending order of the number of tokens.

CopsAndRobbers6

You can view the graph of the fraction of cops wins.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages