GithubHelp home page GithubHelp logo

bfup-project-madssw2's Introduction

Scrabble bot: mads

Steps Completed:

  • Multi-player and dictionary (yes)
  • Parsing boards playing on all boards (no)
  • Parallelism (yes)
  • Respect the timeout flag (yes, should respect the timeout flag, but will only pass or change pieces upon reaching it)

Installation

https://dotnet.microsoft.com/en-us/download

Usage

  1. From project root

cd to root folder

dotnet run --project ScrabbleTemplate
  1. From ScrabbleTemplate project

cd to root folder

cd ScrabbleTemplate
dotnet run
  1. Use JetBrains Rider deafult run configuration

If you wish to change the match configuration, eg make the bot play against itself Go to ScrabbleTemplate/program.cs uncomment the lines setting the players variables and uncomment or create the desired players collection.

License

MIT

bfup-project-madssw2's People

Contributors

akongstad avatar carlbrr avatar garbarsch avatar

Watchers

 avatar

bfup-project-madssw2's Issues

Calculating points(Optional)

Calculating points is not necessary to pass the project, but it is necessary to play well..
image
image
image

  • Do 3.8 and 2.17
  • Convert map to a list and appeal to 3.8. (the square type in 3.8 was type square = (int * squareFun) list rather than a
    map)
  • Implement in project?

Forfeit: check number of players left

When the players receive a CMForfeit, remove 1 from numberOfPlayers in the state. If the numberOfPlayers is 1, then we have a winner.

  • [] decrement numberOfPlayers on message received

  • [] check if 1

  • [] announce winner if 1

The main game loop

The main game loop
image
image

  • Look over loop. Understand internal logic and how it works
  • Replace "let move = RegEx.parseMove input" with the function, which determines a move for mads

Finding valid moves to play

Is your feature request related to a problem? Please describe.
Find valid moves using the pieces you have on hand and the state of the
board find.
image
image

  • Traverse the board to search for a move
  • Implement heuristic
  • First move you find
  • Longest word you find
  • Highest scoring word you find

Maintaining a state

Maintaining a state
image
image
image

  • Track: Who's turn it is
  • Track: How many player there are
  • Track: Who has forfeited
  • Figure out what else we want to keep track of

Parallelism and interrupts(Optional)

Parallelising a scrabble engine is in principle close to trivial as very few of the computations depend on
previous one.

image
image
image

  • Choose between: Use the Async framework and (most likely simpler) System.Threading.Tasks.Parallel.ForEach:
    IEnumerable<โ€˜a> -> (โ€˜a -> unit) -> ParallelLoopResult
  • Find out when to and when not to use parallelism. There are several options, we cant choose all of them because of overhead

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.