Skip to content

Instantly share code, notes, and snippets.

@DeclanHoare
DeclanHoare / 99bottles.c
Last active November 20, 2020 09:24
99bottles polyglot take 2 (C, C++, HolyC, C#, HTML (with Javascript), Python 2.7 and 3)
#if U64_MIN //\
"""
#endif
/* """
from __future__ import print_function
def printf(fmt, *args):
print(fmt % args, end = "")
return 1
"""
@DeclanHoare
DeclanHoare / all_upgrades.txt
Created September 9, 2017 11:56
all ShiftOS upgrades as of phil's last version
Name: Gray
Price: 20 CP
Description:
Everything doesn't always have to be black and white. Give your
programs and GUI some depth by mixing black and white together to form
grey. Note: You are unable to make controls grey until you buy the
Shifter.
Tutorial:
@DeclanHoare
DeclanHoare / SaveSystem.cs
Created August 26, 2017 15:00
Holey Moley Code Dupe
// Define BINARY_SAVE before release so the player has
// to put some effort into cheating ;)
// During development, leave it undefined to use the
// easily modifiable JSON serialised format
//#define BINARY_SAVE
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@DeclanHoare
DeclanHoare / fractran.py
Last active August 25, 2017 12:23
fractran interpreter in python
import sys
if len(sys.argv) != 3:
sys.stderr.write("usage: " + sys.argv[0] + " PROGRAM INPUT\n")
sys.exit(1)
inp = int(sys.argv[2])
sys.stdout.write(str(inp) + " ")
symbols = []
@DeclanHoare
DeclanHoare / README
Created August 11, 2017 14:32
GNOME Technology Release for Red Hat Linux 5.1 (on CD1)
GNOME Technology Release for Red Hat Linux 5.1
----------------------------------------------
This is a preview of the GNOME desktop environment (see http://www.gnome.org
for all the details). This is a BETA release - you can run it and try
it out for a demonstration of what GNOME will bring to your PC. However,
GNOME is being activitely developed every minute of the day by programmers
worldwide, so this snapshot of their efforts is not quite a finished work yet.
Hopefully you will find that it has many useful features, but understand
that if some parts aren't quite finely polished yet that this is just a
@DeclanHoare
DeclanHoare / arooo_sdl.c
Last active August 5, 2017 06:35
AROOO SDL
/*
Copyright 2017 Declan Hoare
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@DeclanHoare
DeclanHoare / shuffle.cpp
Created August 2, 2017 07:29
shuffle stdin while removing empty lines: c++ vs python
#include <random>
#include <algorithm>
#include <string>
#include <vector>
#include <iostream>
int main()
{
std::vector<std::string> files;
std::random_device rd;
@DeclanHoare
DeclanHoare / 99bottles.c
Last active August 26, 2021 15:02
A 99 bottles polyglot in 4 languages (C, C++, C#, HTML+JS) which only states the logic and text once
/*
<script type="text/javascript">
var ourtext = "";
function printf(format, number)
{
ourtext += format.replace("%d", number).replace("\n", "<br />");
}
function display()
{
document.body.innerHTML = ourtext;
@DeclanHoare
DeclanHoare / LLFS_design.txt
Last active September 25, 2017 22:50
LLFS design
at the start: "LLFS"
8-byte pointer to first used node or NULL
8-byte pointer to last used node or NULL
8-byte pointer to first free file node or NULL
8-byte pointer to last free file node or NULL
8-byte pointer to first free directory node or NULL
8-byte pointer to last free directory node or NULL
8-byte pointer to end of file system
Each node has:
@DeclanHoare
DeclanHoare / EXAM_8_8.C
Last active July 16, 2017 05:50
why does it use conio
/* Chapter 8 Example 8.8 */
/* //////////////////////////////////////////
program: EXAM_8_8.C
This program reads strings from a 2-d array
and stores them in a data file
///////////////////////////////////////// */
#include <stdio.h>
#include <conio.h>