Skip to content

Instantly share code, notes, and snippets.

@nns2009
nns2009 / 0 - Worst game of the jam - Video making.md
Last active September 17, 2022 15:24
Worst game of the jam - Video making

Watch the video about how I made the Worst game of the Brackeys jam (out of 1086):

https://youtu.be/Tpeu1-gqA3o

These are Google Chrome console scripts I used to make this video in the order I used them

// ----------------------------------------------------------
// ----------------------------------------------------------
// --------------------- Farm with Code ---------------------
// ----------------------------------------------------------
// ----------------------------------------------------------
// In this game you need to code your drone(s) in JavaScript to farm for you.
// Here is a sample code to do some farming.
// Read game page for more instructions.
# Made in 21 second
# Watch this video to see how:
# https://youtu.be/r3a9obNqno4
from random import randint
m = 5
while True:
a = randint(m, 3*m)
b = randint(m, 3*m)
print(f'{a} * {b} = ?')
@nns2009
nns2009 / Bachet game in 1 minute.py
Last active October 9, 2022 11:49
I made a game (Bachet/Nim) in under one minute (once again, this is the second one), here it is
# Made in 43 seconds
# Watch this video to see how:
# https://youtu.be/vnYES_fba-M
from random import randint
n = randint(20, 30)
while True:
print(f'{n:2}', '|' * n)
@nns2009
nns2009 / ParametricObjectEditor.cs
Created November 14, 2020 23:10
Unity custom editor for parametric objects
// This script is the common part of the set up to use parametric objects in Unity:
// Watch the video-tutorial with explanation here:
// https://youtu.be/KCDYdQUufhs
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
[CustomEditor(typeof(Room))]
@nns2009
nns2009 / CountSort.js
Last active October 7, 2020 18:12
Count sort made while counting every single key pressed
// Count sort I coded while counting every single key I press
// Watch video here:
// https://youtu.be/HFgzhYHM4QM
function countSort(vs) {
const cs = Array(Math.max(...vs) + 1).fill(0);
let res = [];
for (let v of vs)
cs[v]++;
for (let v = 0; v < cs.length; v++) {
for (let c = 0; c < cs[v]; c++)
@nns2009
nns2009 / 10 Minute Game.cs
Created September 20, 2020 00:26
Polished maze game made in under 10 minutes with Unity
// Made from scratch in just 8 minutes 23 seconds
// Watch this video to see how:
// https://youtu.be/aP9eKrnyxe4
// Play online here:
// https://nns2009.itch.io/just-maze
using Cinemachine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
@nns2009
nns2009 / RandomSort.js
Last active September 8, 2020 15:26
Random Sort incorporates principles of security through obscurity to make your most sensitive pieces of code safe
// Watch this video to see how I crafted this sorting algorithm:
// https://youtu.be/Mh_1V95n0j0
function bDQnoAh__3IqiQ6w(MbK$rQXzgSJSupW) {
return Math.floor(Math.random() * MbK$rQXzgSJSupW);
}
function E68sk_VA6aM3y9ts1DO4S(xAAyxUzJedDW4t_) {
for (let SUiFIpIVdvQFCy = 1; SUiFIpIVdvQFCy < xAAyxUzJedDW4t_.length; SUiFIpIVdvQFCy++) {
if (xAAyxUzJedDW4t_[SUiFIpIVdvQFCy-1] > xAAyxUzJedDW4t_[SUiFIpIVdvQFCy])
@nns2009
nns2009 / 1 Minute Game.py
Last active September 1, 2020 09:55
I made a game in under one minute, here it is
# Made in 37 seconds
# Watch this video to see how:
# https://youtu.be/uvKG7uki_N8
# Play the extended HTML port on Itch:
# https://nns2009.itch.io/guess-with-lies
from random import randrange
n = randrange(10000)
while True:
v = int(input())
@nns2009
nns2009 / BinaryTreeSort.js
Last active June 13, 2024 09:36
Binary Tree Sort in 3 lines of code in JavaScript
// Watch https://youtu.be/KvYzGsz5vHA to see how I coded this with some commentary
let add = (n, v) => !n ? { v } : { ...n, [v < n.v]: add(n[v < n.v], v) }
let flat = n => !n ? [] : [...flat(n[!0]), n.v, ...flat(n[!1])]
let bsort = vs => flat(vs.reduce(add, null))
// 182 characters with nice formatting
let add=(n,v)=>!n?{v}:{...n,[v<n.v]:add(n[v<n.v],v)}
let flat=n=>!n?[]:[...flat(n[!0]),n.v,...flat(n[!1])]
let bsort=vs=>flat(vs.reduce(add,null))