Skip to content

Instantly share code, notes, and snippets.

@190n
190n / prisoners.zig
Created July 1, 2022 19:14
100 prisoners in zig
// based on https://www.youtube.com/watch?v=iSNsgj1OCLA
const std = @import("std");
const Strategy = fn (my_num: u32, boxes: [100]u32, random: std.rand.Random) bool;
fn searchRandom(my_num: u32, boxes: [100]u32, random: std.rand.Random) bool {
var i: u32 = 0;
var tried = [_]bool{false} ** 100;
while (i < 50) : (i += 1) {
const guess = blk: {
This file has been truncated, but you can view the full file.
{"requestedUrl":"https://www.cnx-software.com/2021/11/18/save-the-planet-program-in-c-avoid-python-perl/","finalUrl":"https://www.cnx-software.com/2021/11/18/save-the-planet-program-in-c-avoid-python-perl/","lighthouseVersion":"9.0.0","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/95.0.4638.69 Safari/537.36","fetchTime":"2021-11-19T07:42:24.369Z","environment":{"networkUserAgent":"Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4695.0 Mobile Safari/537.36 Chrome-Lighthouse","hostUserAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/95.0.4638.69 Safari/537.36","benchmarkIndex":888.5},"runWarnings":[],"configSettings":{"emulatedFormFactor":"mobile","formFactor":"mobile","locale":"en-US","onlyCategories":["performance","accessibility","best-practices","seo"],"channel":"lr"},"audits":{"screenshot-thumbnails":{"id":"screenshot-thumbnails","title":"Screenshot Thumbnails","d
@190n
190n / iterative-incomplete.py
Created February 4, 2020 04:07
Binary to decimal conversion with Python
def binary_to_decimal_iterative(binary):
total = 0
for i in range(len(binary)):
if binary[i] == '1':
pass
return total
/*****************
* bossFight.js *
*****************
*
* NO FARTHER, DR. EVAL!!!!
* YOU WILL NOT GET OUT OF HERE ALIVE!!!!
* IT'S TIME YOU SEE MY TRUE FORM!!!!
* FACE MY ROBOT WRATH!!!!!
*/
@190n
190n / LICENSE.txt
Last active February 1, 2018 13:44 — forked from 140bytes/LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@190n
190n / npm-debug.log
Created June 10, 2015 02:20
npm-debug.log
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/bin/npm', 'install', '--save', 'gui' ]
2 info using npm@2.11.1
3 info using node@v0.12.4
4 verbose node symlink /usr/bin/node
5 verbose install initial load of /home/ben/code/gui/test/package.json
6 warn package.json @ No description
7 warn package.json @ No repository field.
8 warn package.json @ No README data
9 warn package.json @ No license field.
@190n
190n / LICENSE.txt
Last active August 29, 2015 14:02 — forked from 140bytes/LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE