0

What are the first steps for implementing a DAWG or GADDAG in browser in Javascript (without overloading memory)? Specifically, I want to port this data structure into an interactive Scrabble game in browser so that humans can play against a computer.

This computer implements the DAWG/GADDAG structure proposed by Eric Sink (http://ericsink.com/downloads/faster-scrabble-gordon.pdf).

I've already written code in Python that successfully calculates the optimal next move based on a GADDAG, but I'm now struggling to figure out how to port this into Javascript/HTML, given the memory constraints in browser. Currently in Python, this GADDAG structure consumes ~800 MB.

Do I have to construct the DAWG/GADDAG beforehand into a text file, then load the text file into browser? Or should I implement it client-side? I'm trying to figure out all the different ways for loading this data structure into an interactive browser game.

Daniel
  • 1
  • 1
  • 1
  • Retrieving the whole dictionary from the server and building the DAWG locally doesn't sound like a reasonable option. So the DAWG should probably be built on server-side. You may want to save a local copy, using either [localStorage](https://developer.mozilla.org/en/docs/Web/API/Window/localStorage) or [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API). – Arnauld Aug 13 '16 at 18:51
  • Thank you Arnauld. I will tinker with local storage as well. I'll also have to figure out how to condense further as my current 800 MB size is too large still. – Daniel Aug 21 '16 at 20:23

0 Answers0