Tools for teachers and students using nng (Natural Number Game)

Related tags

Miscellaneousnngtools
Overview

nngtools

Usage

  1. Place your nngsave.json to the directory in which you want to extract the level files.
  2. Place nngmap.json on the same directory.
  3. Run nngsave2files.py nngsave.json. This should create a bunch of wold dirs / level files.

How to save/load your game

The following is taken from this message by mpedramfar. I have altered the savegame javascript code to: (i) prettyprint the json file instead of dumping it as a single line; (ii) use the name nngsave.json for the created file.

Create the bookmarks:

  • nng-save, using the following URL:
javascript:(function save(data, filename) { if(!window.location.href.endsWith("natural_number_game/")){ alert("To load saved game, go to the main page first!"); return;  }; var file = new Blob([JSON.stringify(JSON.parse(data), null, 2)]); var a = document.createElement("a"), url = URL.createObjectURL(file); a.href = url; a.download = filename; document.body.appendChild(a); a.click(); setTimeout(function() { document.body.removeChild(a); window.URL.revokeObjectURL(url);  }, 0);  })(window.localStorage.getItem("Natural number game-1-savedGameData"), "nngsave.json");
  • nng-load, with the following URL:
{ const files = uploader.files; if (files.length) { const reader = new FileReader(); reader.addEventListener('load', () => { uploader.parentNode.removeChild(uploader); resolve(reader.result); }); reader.readAsText(files[0]); }; }); document.body.appendChild(uploader); document.getElementById("root").style.display = 'none'; }; }); })().then(text => { console.log(text); if(text){ window.localStorage.setItem("Natural number game-1-savedGameData", text); window.location.reload(); }; });">
javascript:(function(){ return new Promise((resolve) => { if(!window.location.href.endsWith("natural_number_game/")){ alert("To load saved game, go to the main page first!"); resolve("");  }else{ const uploader = document.createElement('input'); uploader.type = 'file'; uploader.style.position = 'relative'; uploader.addEventListener('change', () => { const files = uploader.files; if (files.length) { const reader = new FileReader(); reader.addEventListener('load', () => { uploader.parentNode.removeChild(uploader); resolve(reader.result);  }); reader.readAsText(files[0]);  };  }); document.body.appendChild(uploader); document.getElementById("root").style.display = 'none';  };  });  })().then(text => { console.log(text); if(text){ window.localStorage.setItem("Natural number game-1-savedGameData", text); window.location.reload();  };  });

Notes

The file nngmap.json contains a map from level statements to world and level numbers. This file is created by running mknngmap.py on a complete nng savegame, placed on the src/game directory of natural_number_game. Normally you will not need to run this; you can just use the nngmap.json provided here.

Owner
Thanos Tsouanas
Thanos Tsouanas
A place where one-off ideas/partial projects can live comfortably

A place to post ideas, partial projects, or anything else that doesn't necessarily warrant its own repo, from my mind to the web.

Carson Scott 2 Feb 25, 2022
A software dedicated to automaticaly select the agent of your desire in Valorant

AUTOPICKER A software dedicated to automaticaly select the agent of your desire in Valorant GUIDE Before stariting to use this program check if you ha

p1n00 0 Sep 24, 2022
My solution for a MARL problem on a Grid Environment with Q-tables.

To run the project, run: conda create --name env python=3.7 pip install -r requirements.txt python run.py To-do: Add direction to the state space Take

Merve Noyan 12 Dec 25, 2021
Ked interpreter built with Lex, Yacc and Python

Ked Ked is the first programming language known to hail from The People's Republic of Cork. It was first discovered and partially described by Adam Ly

Eoin O'Brien 1 Feb 08, 2022
Repo with data from local elections in Portugal from 2009 to 2013

autarquicas - local elections in Portugal Repo with data from local elections in Portugal from 2009 to 2013 Objective To provide, to all, raw data fro

Jorge Gomes 6 Apr 06, 2022
In this project, we'll be creating a virtual personal assistant for ourselves using our favorite programming language

In this project, we'll be creating a virtual personal assistant for ourselves using our favorite programming language, Python. We can perform several offline as well as online operations using the bo

Ashutosh Krishna 188 Jan 03, 2023
Object-data mapper and advanced query manager for non relational databases

Object data mapper and advanced query manager for non relational databases. The data is owned by different, configurable back-end databases and it is

Luca Sbardella 121 Aug 11, 2022
a really simple bot that send you memes from reddit to whatsapp

a really simple bot that send you memes from reddit to whatsapp want to use use it? install the dependencies with pip3 install -r requirements.txt the

pai 10 Nov 28, 2021
A lightweight solution for local Particle development.

neopo A lightweight solution for local Particle development. Features Builds Particle projects locally without any overhead. Compatible with Particle

Nathan Robinson 19 Jan 01, 2023
Fully cross-platform toolkit (and library!) for MachO+Obj-C editing/analysis

fully cross-platform toolkit (and library!) for MachO+Obj-C editing/analysis. Includes a cli kit, a curses GUI, ObjC header dumping, and much more.

cynder 301 Dec 28, 2022
Python library for Minitel communication through serial port

Python library for Minitel communication through serial port

Noël 3 Aug 14, 2022
Usando Multi Player Perceptron e Regressão Logistica para classificação de SPAM

Relatório dos procedimentos executados e resultados obtidos. Objetivos Treinar um modelo para classificação de SPAM usando o dataset train_data. Class

André Mediote 1 Feb 02, 2022
The official repository of iGEM Paris Bettencourt team's software tools.

iGEM_ParisBettencourt21 The official repository of iGEM Paris Bettencourt team's software tools. Cell counting There are two programs dedicated to the

Abhay Koushik 1 Oct 21, 2021
Script that creates graphical representations of Julia an Mandelbrot sets.

Julia and Mandelbrot Picture Maker This simple functions create simple plots of the Julia and Mandelbrot sets. The Julia set require the important par

Juan Riera Gomez 1 Jan 10, 2022
Some basic sorting algos

Sorting-Algos Some basic sorting algos HacktoberFest 2021 This repository consists of mezzo-level projects that undertake a simple task and perform it

Manthan Ghasadiya 7 Dec 13, 2022
Xkcd.py - Script to generate wallpapers based on XKCD comics

xkcd.py Script to generate wallpapers based on XKCD comics Usage python3 xkcd.py

Gideon Wolfe 11 Sep 06, 2022
Find out where all films you want to watch are streaming

Just Watch Letterboxd Find out where all films you want to watch are streaming Ever wonder what films you want to watch are already on the streaming p

Jordan Oslislo 2 Feb 04, 2022
Enjoyable scripting experience with Python

Enjoyable scripting experience with Python

8 Jun 08, 2022
This is the course repository for the Spring 2022 iteration of MACS 30123 "Large-Scale Computing for the Social Sciences" at the University of Chicago.

Large-Scale Computing for the Social Sciences Spring 2022 - MACS 30123/MAPS 30123/PLSC 30123 Instructor Information TA Information TA Information Cour

6 May 06, 2022
A step-by-step tutorial for how to work with some of the most basic features of Nav2 using a Jupyter Notebook in a warehouse environment to create a basic application.

This project has a step-by-step tutorial for how to work with some of the most basic features of Nav2 using a Jupyter Notebook in a warehouse environment to create a basic application.

Steve Macenski 49 Dec 22, 2022