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
contextlib2 is a backport of the standard library's contextlib module to earlier Python versions.

contextlib2 is a backport of the standard library's contextlib module to earlier Python versions. It also sometimes serves as a real world proving gro

Jazzband 35 Dec 23, 2022
Hello World in different languages !

Hello World And some Examples in different Programming Languages This repository contains a big list of programming languages and some examples for th

AmirHossein Mohammadi 131 Dec 26, 2022
Backend/API for the Mumble.dev, an open source social media application.

Welcome to the Mumble Api Repository Getting Started If you are trying to use this project for the first time, you can get up and running by following

Dennis Ivy 189 Dec 27, 2022
The tool helps to find hidden parameters that can be vulnerable or can reveal interesting functionality that other hunters miss.

The tool helps to find hidden parameters that can be vulnerable or can reveal interesting functionality that other hunters miss. Greater accuracy is achieved thanks to the line-by-line comparison of

197 Nov 14, 2022
A variant caller for the GBA gene using WGS data

Gauchian: WGS-based GBA variant caller Gauchian is a targeted variant caller for the GBA gene based on a whole-genome sequencing (WGS) BAM file. Gauch

Illumina 16 Oct 13, 2022
Python Service for MISP Feed Management

Python Service for MISP Feed Management This set of scripts is designed to offer better reliability and more control over the fetching of feeds into M

Chris 7 Aug 24, 2022
NasaApod - Astronomy Picture of the Day

Astronomy Picture of the Day Get interesting Astronomical pictures with a brief

Shripad Rao 1 Feb 15, 2022
Simple GUI menu for micropython using a rotary encoder and basic display.

Micropython encoder based menu This is a simple menu system written in micropython. It uses a switch, a rotary encoder and an OLED display.

80 Jan 07, 2023
libvcs - abstraction layer for vcs, powers vcspull.

libvcs - abstraction layer for vcs, powers vcspull. Setup $ pip install libvcs Open up python: $ python # or for nice autocomplete and syntax highlig

python utilities for version control 46 Dec 14, 2022
samples of neat code

NEAT-samples Some samples of code and config files for use with the NEAT-Python package These samples are largely copy and pasted, so if you

Harrison 50 Sep 28, 2022
Make after-work Mending More flexible In Python

Mending Make after-work Mending More flexible In Python A Lite Package focuses on making project's after-post mending pythonic and flexible. Certainly

2 Jun 15, 2022
March-madness - March Madness results 1985-2021

march-madness Results for all 2,268 NCAA Division I Men's Basketball Tournament games since the modern format was introduced in 1985. Includes years,

Darik Harter 2 Feb 26, 2022
Covid-19-Trends - A project that me and my friends created as the CSC110 Final Project at UofT

Covid-19-Trends Introduction The COVID-19 pandemic has caused severe financial s

1 Jan 07, 2022
A python script to decrypt media files encrypted using the Android application 'Secret Calculator Photo Vault'. Supports brute force of PIN also.

A python script to decrypt media files encrypted using the Android application 'Secret Calculator Photo Vault'. Supports brute force of PIN also.

3 May 01, 2022
PyWorkflow(PyWF) - A Python Binding of C++ Workflow

PyWorkflow(PyWF) - A Python Binding of C++ Workflow 概览 C++ Workflow是一个高性能的异步引擎,本项目着力于实现一个Python版的Workflow,让Python用户也能享受Workflow带来的绝佳体验。

Sogou-inc 108 Dec 01, 2022
Using graph_nets for pion classification and energy regression. Contributions from LLNL and LBNL

nbdev template Use this template to more easily create your nbdev project. If you are using an older version of this template, and want to upgrade to

3 Nov 23, 2022
Statically typed BNF with semantic actions; A frontend of frontend frameworks; Use your grammar everywhere.

Statically typed BNF with semantic actions; A frontend of frontend frameworks; Use your grammar everywhere.

Taine Zhao 56 Dec 14, 2022
A python script that automatically joins a zoom meeting based on your timetable.

Zoom Automation A python script that automatically joins a zoom meeting based on your timetable. What does it do? It performs the following processes:

Shourya Gupta 3 Jan 01, 2022
Solcast Integration for Home Assistant

Solcast Solar Home Assistant(https://www.home-assistant.io/) Component This custom component integrates the Solcast API into Home Assistant. Modified

Greg 45 Dec 20, 2022
A bash-like intrepreted language

A Bash-like interpreted scripting language.

AshVXmc 1 Oct 28, 2021