This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ------------------------------------------------------------------------------- | |
// CoreAudio continuous play test | |
// (c) 2014 by @zenmumbler | |
// created: 2014-12-07 | |
// | |
// As part of my efforts for stardazed and to create a Mac OS X version of | |
// Handmade Hero. | |
// | |
// compile with: | |
// clang++ -std=c++11 -stdlib=libc++ -framework AudioToolbox catest.cpp -o catest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Bare bones Handmade Hero-like functionality (but not in HH coding style) | |
// Simple graphics, runloop and initialization only, needs a XIB for the menubar etc. | |
// Compiles as normal Objective-C | |
// (c) 2014 by @zenmumbler | |
#import <Cocoa/Cocoa.h> | |
#import <CoreGraphics/CoreGraphics.h> | |
#include <stdint.h> | |
static bool running = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Basic Unity-like Coroutines</title> | |
<script> | |
/* | |
This example illustrates a simple coroutine controller to act similarly to how Unity's | |
system works. The payload here is not very exciting but focus on the fact that the actual effort | |
in a normal usage scenario would just be writing the more() function and starting it somewhere. | |
This example will run happily in Safari 10+, Edge 13+, Firefox and Chrome. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* SuSo - C version - (c) 2018 by @zenmumbler | |
* The C version of my implementation of a brute-force Sudoku solver. | |
* For a web version see https://zenmumbler.net/suso/ | |
* Compiled with -O3 this takes about 2.3ms to solve on my 2013 iMac | |
* I found the puzzle online by looking for "very hard sudoku" | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <functional> | |
#include <unordered_map> | |
#include <chrono> | |
// This file was tested only in clang 3.4 | |
// It requires -std=c++1y and a stdlib conforming to at least C++11 | |
template <typename T, typename U> | |
auto memoize(std::function<U(T)>&& f) { |