Skip to content

mfbx9da4/treasure

Repository files navigation

npm run build && surge --domain treasure.surge.sh

Demo

image

Description

The aim of this game is to demonstrate the power of binary search algorithms to novice programmers. The user should first try and create a strategy for finding the treasure. Most likely the user will stumble upon a strategy very similar to binary search. Try starting with a one dimensional array first.

Binary search strategy can be summarized by: dividing the grid in half each time until you reach one possible cell. The number of times it takes to divide a number in half until you reach one is the definition of log_base_2(N). Therefore using the binary search strategy, the best number of guesses to find the treasure is log_base_2(totalCells). Checkout the solver tab to see binary search in action.

I would like to turn this in to a talk at some point and using the analogy of advent calendars. Here are the slides.

treasure

image image

About

A game to introduce the concept of binary search in an intuitive way

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy