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
// The code should be compatible with IE5, expect some bugs in jank JavaScript versions though... | |
(function RobotAPI(global) { | |
// The class of a Robot | |
function Robot(name, language, dictionary) { | |
// Default arguments not in IE, sorry for the oncoming code clutter... -_- | |
if (arguments.length < 3) { | |
dictionary = new RobotDictionary(Robot.getTestDictionary()); | |
if (arguments.length < 2) { | |
language = Robot.getTestLanguage().filter(Boolean); |
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
draw_line(angle, length) { | |
x = 0, y = 0; | |
xRatio, yRatio; // Asserts how the line is weighted between the x and y axis | |
xRate = 0, yRate = 0; // Sets up the ratios | |
// Set up the rates | |
{ | |
iterator = 0; | |
for (; iterator <= angle; ++iterator) { | |
if (iterator >= 0 and iterator < 90) { ++xRate; ++yRate; } |
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
draw_line(x1, x2, y1, y2) { | |
x = 0, y = 0; // where each pixel of the line is drawn | |
xLength = abs(x1 - x2), yLength = abs(y1 - y2); | |
xRatio = 1, yRatio = 1; // Asserts how the line is weighted between the x and y axis | |
if (xLength > yLength) yRatio = yLength / xLength; | |
else if (xLength < yLength) xRatio = xLength / yLength; | |
// draw the line | |
xIterator = 0; // for progressing through the iteration |
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 <cstddef> | |
/* ... --> search<𝓍>(…) */ | |
template <std::size_t count, typename type> | |
bool search(type const& key, type const array[], std::size_t length) noexcept { | |
union { | |
type const *stop; // ->> for elements missed via `0u != count % length` | |
type const *stops[count]; | |
}; |
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
Object.defineProperty(Object.prototype, "def", (function() { | |
// ... | |
var UNINITIALIZED = {}; | |
// ... | |
function assert(identifier, value, constraints) { | |
for (var iterator = constraints.length - 1; ~iterator; --iterator) | |
switch (constraints[iterator]) { | |
case null: if (null === value) return; break; | |
case "bigint": if ("bigint" === typeof value) return; break; |
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 <cstdio> | |
/* ... */ | |
#define concatenate(argument1, argument2) argument1 ## argument2 | |
#define count(...) ( \ | |
count_arity(__VA_ARGS__, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75 |
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
/* Pending updates… */ | |
#include <cstdarg> | |
#include <type_traits> | |
#include <utility> | |
/* ... */ | |
namespace { | |
struct halt final { | |
constexpr inline halt(...) noexcept = delete; | |
}; |
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
/* Pending updates… */ | |
#include <cstddef> | |
#include <type_traits> | |
#include <utility> | |
#include <version> | |
#ifdef __clang__ | |
# pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" | |
#endif |
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 <cstdlib> | |
/* ... */ | |
template <typename base> | |
struct nil final { | |
private: | |
template <typename subbase, typename = subbase> | |
struct valueof final { | |
friend struct nil; |
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
ipow(base, exponent) { | |
var power = 1; | |
// … | |
for (count = 1, multipliers = list(base); exponent; ) { | |
var multiplier = multipliers[multipliers.length - 1]; | |
// … | |
if (count != exponent) { | |
count *= 2; |