Giter Site home page Giter Site logo

boggle's Introduction

Boggle

This project is a speed-optimized Java program designed to solve Boggle boards, prioritizing fast execution over memory efficiency.

Boggle is a word game. It involves a board made up of 16 cubic dice, where each die has a letter printed on each of its 6 sides. At the beginning of the game, the 16 dice are shaken and randomly distributed into a 4-by-4 tray, with only the top sides of the dice visible. The players compete to accumulate points by building valid words from the dice, according to these rules:

  • A valid word must be composed by following a sequence of adjacent dice—two dice are adjacent if they are horizontal, vertical, or diagonal neighbors.

  • A valid word can use each die at most once.

  • A valid word must contain at least 3 letters.

  • A valid word must be in the dictionary (which typically does not contain proper nouns).

Here are some examples of valid and invalid words:

Boggle1


Implementation

Checking the words in the dictionary while researching the words on the Boggle board is the most crucial part of the problem. Therefore, the key focus of this project lies in employing a data structure that efficiently supports string search. I have chosen to use the trie data structure for its ability to provide the fastest string search.

Trie data structure

A trie is a multiway tree data structure used for storing strings over an alphabet. It is used to store a large amount of strings. The pattern matching can be done efficiently using tries. Preprocessing pattern improves the performance of pattern matching algorithm.

The idea is that all strings sharing common prefix should come from a common node.

Boggle2


Scoring

Valid words are scored according to their length, using this table:

Boggle3


Performance

This program can preprocess the dictionary to identify all valid words on a randomly generated Boggle board in a fraction of a second. The primary objective of this project is to achieve raw speed, and the code is designed under the assumption that there are no memory limitations. It is capable of solving thousands of random Boggle boards per second.



Mustafa Turgut
[email protected]

boggle's People

Contributors

mstfturgut avatar

Watchers

 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.