Code Monkey home page Code Monkey logo

js-boggle-challenge's Introduction

General Assembly Logo

Boggle challenge

Test for words on a boggle board.

Instructions

  1. Fork and clone this repository.
  2. Change into the new directory.
  3. Install dependencies.
  4. Create and checkout a new branch to work on.
  5. Fulfill the listed requirements.

Starter code is available in lib/challenge.js. A pull request is not required, but it is necessary if you want a code review.

You may wish to refer to FAQs related to forking, cloning.

Requirements

Map row/column coordinates onto an array index (i.e. represent a square grid using a simple array). Use this mapping to return (potential) words from letters in the grid.

Boggle is a word game played with letter-dice arrange in a 4X4 tray.

A tray is just an array of length 16 with each element a single letter string.

A list of coordinate pairs is an array with length <= 4 and each element is an array of length 2. The sub-arrays contain two integers >= 0 and <= 3.

Write a function - in lib/challenge.js - that takes a tray and a list of coordinate pairs and returns a string representing the concatenation of the letters at each of the coordinates.

See bin/challenge.js for an example invocation. Run it with node bin/challenge.js.

You should run grunt nag before diagnosing any bugs, since it finds some of the most common sources of errors. After grunt nag passes, you should run grunt test to run the included tests. Tests will tell you whether of not you've met these requirements.

Bonuses

Only try these after completing the main challenge.

Big Boggle challenge

Big Boggle uses a 5X5 tray.

Make the following change in spec/challenge.spec.js to enable tests for this bonus.

- xdescribe('Big Boggle', () => {
+ describe('Big Boggle', () => {

Super Big Boggle challenge

Super Big Boggle uses a 6X6 tray.

Make the following change in spec/challenge.spec.js to enable tests for this bonus.

- xdescribe('Super Big Boggle', () => {
+ describe('Super Big Boggle', () => {

Validate inputs

  • Ensure tray has the correct length
  • Ensure that coordinates fall within the tray
  • Disallow coordinate pairs that aren't in a line

Return the empty string if a validation fails

Source code distributed under the MIT license. Text and other assets copyright General Assembly, Inc., all rights reserved.

js-boggle-challenge's People

Watchers

James Cloos avatar Michael Bates 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.