Skip to content

Latest commit

 

History

History
65 lines (38 loc) · 4.26 KB

README.md

File metadata and controls

65 lines (38 loc) · 4.26 KB

Wordle Assistant

A Wordle solver running on ABAP transpiled into JS

Solution

The application is available at https://wordle.marcbernardtools.com.

image

Example Result

image

Design

The solution is based on Zwordle by Huge de Groot. The original code was adjusted slightly to be compatible with Open-ABAP. This ABAP code was then transpiled into JavaScript using the ABAP to JS transpiler. Some placeholders were added for passing user input to this JS code. Finally, the JS code was bundled together with the abaplint runtime using browserify. The resulting website consists of only three files: One for HTML, one for JavaScript, and one for the Favicon.

How To

I took the original Zwordle code and placed it into an ABAP class. The input parameters of the main class method represent the selection-screen parameters of the original program. This code is now compatible with Open-ABAP.

Next, I pasted the Open-ABAP code into the ABAP to JS transpiler playground and captured the resulting JavaScript code from the middle panel. It's certainly possible to incorporate this transpilation step into the website as well, but here the ABAP code and therefore the resulting JavaScript won't change. So, why bother?

To link the input from the website to the transpiled ABAP code, I added some placeholders into the method call (see $$var$$ here). These placeholders will be replaced by the user input using JavaScript.

When the user clicks the button or hits enter, it will execute the Open-ABAP code and return the console output to the HTML page.

Finally, I used browserify to bundle the JS of this app and the abaplint runtime together into a single JS file which is embedded in the HTML page.

Build Yourself

  1. Clone this repo
  2. Run npm install Optionally:
  • Edit index.html, main.js, or abap/zwordle.abap
  • Transpile zwordle.abap into abap/abap.js (if ABAP has changed)
  • Add placeholders to abap/abap.js (see above)
  1. Edit node_modules\@abaplint\runtime\build\src\statements\index.js and remove the dependency on node built-in util/types (remove const types_1 ... and its usage)
  2. Bundle the app with npm run build
  3. Copy index.html, dist/bundle.js, and favicon.ico to your host (or use GitHub pages)

Code

Credits

Zwordle by Hugo de Groot: MIT

Transpiler by Lars Hvam: MIT

Port of Zwordle to transpiler and stand-alone website by Marc Bernard: MIT

About

Made with ❤️ in Canada

Copyright 2022 Marc Bernard https://marcbernardtools.com/

Follow @marcfbe on Twitter

MBT Logo