Provide 4 ways of programming stress inversion:
- using JavaScript and procedural programming (~80 lines of code)
- using Python, procedural programming and object oriented programming (150-200 lines of code)
- using TypeScript, object oriented and procedural programming (~330 lines of code)
- in the browser using
index.html
Folder inversion
contains the same classes as in invert-class.py
, but split the code into multiple files, and introduces the notion of data factory.
- PyCharm IDE, Community Edition for python
- node for JavaScript
- deno for TypeScript
- Visual Studio Code (for JavaScript and TypeScript)
Directly from PyCharm by selecting either invert-function.py
or invert-class.py
.
node invert.js
deno run invert.ts
Deno will ask you the permission to read the two files from your folder, and will display:
⚠️ Deno requests read access to "matelles-joints.txt".
├ Requested by `Deno.readFileSync()` API.
├ Run again with --allow-read to bypass this prompt.
└ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all read permissions) >
To bypass this prompt, prefer to use --allow-read
:
deno run --allow-read invert.ts
The index.html file embeds JavaScript code to represent the cost domain, including both the code and data from Les Matelles.
Simply click here to display the cost domain.