Memory is a map of tapes, where the keys are strings and values are arbitrary-sized integers.
Additionally, there is a set of labels, where the program can jump to.
There is a stack, which contains the operands, which are strings.
Memory is a map of tapes, where the keys are strings and values are arbitrary-sized integers.
Additionally, there is a set of labels, where the program can jump to.
There is a stack, which contains the operands, which are strings.
require 'matrix' | |
module ReadableArrays | |
def readable(factor: 1, method: :rjust) | |
repr = to_a.map { |row| | |
row.map(&:inspect) | |
} | |
column_widths = repr.transpose.map { |col| | |
col.map(&:size).max + factor |
% yes, I really did implement a turtle for this. | |
%-- turtle functions --% | |
% CONSTANTS | |
/T-Angle 0 def | |
/T-Drawing true def | |
/T-coorfromangle { | |
dup T-Angle cos mul exch T-Angle sin mul | |
} def |
$ops = %w(add subtract multiply divide exit print set input loop end) | |
def getchar | |
res = STDIN.getc.ord rescue 0 | |
end | |
class Numeric | |
def call prog | |
return unless self == 4 | |
unless prog = prog.delete(' ')[/\A3\.(\d*)4\z/, 1] |
import java.util.Scanner; | |
public class Main { | |
public static String convert(String name) { | |
String head = "" + name.charAt(0); | |
head = head.toUpperCase() + name.substring(1).toLowerCase(); | |
return head; | |
} | |
public static void swap(String[] array, int i, int j) { |
0e00e-0e00e----|00e00e--|00e00e00e----|00e00e00e----|--e|--e|--e@0e0e00e--00e00e----|00e00e00e--|00e00e--|--e--|--e|000e-0e00e--00e00e-----|--e-@0e00e-0e00e----|00e00e00e----|00e00e00e----|00e00e00e----|--e|--e|--e:@@0e00e00e----|00e00e00e----|--e|00e00e--00e00e----|00e00e00e----|--e|--e00e-0e-0e--@0e00e-0e00e----|00e00e00e----|00e00e00e----|--e00e-0e--|--e@0e00e-0e00e----|00e00e--|00e00e--00e00e----|--e|--e:@00e-0e-0e-|00e0e00e00e--|00e00e--|--e--|00e00e--00e00e--|00e00e--|--e--|--e-|--e@0e00e00e----|00e00e00e----|--e|00e00e--00e00e----|00e00e00e----|--e|--e00e-0e-0e--@0e00e--|00e00e00e----|--e|00e00e--00e00e----|00e00e00e--|00e00e--|--e--|--e0e-|--e@0e00e-0e00e----|00e00e00e----|00e00e00e----|00e00e00e----|--e|--e|--e@0e00e-0e00e----|00e00e00e--00e00e------|00e00e00e--00e00e------|--e|--e@00e--@ |
#ifndef INCLUDE_MILLISECONDS | |
#define INCLUDE_MILLISECONDS | |
#include <time.h> | |
#ifdef __WIN32 | |
#include <windows.h> | |
#define M_OS_WINDOWS | |
#else | |
#include <sys/time.h> | |
#define M_OS_SANE | |
#endif |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdarg.h> | |
typedef struct operator { | |
char* name; | |
int prec; | |
} operator; |
/** | |
* math.js | |
* https://github.com/josdejong/mathjs | |
* | |
* Math.js is an extensive math library for JavaScript and Node.js, | |
* It features real and complex numbers, units, matrices, a large set of | |
* mathematical functions, and a flexible expression parser. | |
* | |
* @version 2.5.0 | |
* @date 2015-12-05 |
preamble = <<'EOF' | |
#include <stdint.h> | |
#include <stdio.h> | |
int main(){ | |
#define S 65536 | |
uint8_t t[S] = {0}; | |
uint8_t m[S] = {0}; | |
uint16_t p = 0, f = 0, z = 0; | |
int i, q = 0, d = 0, g = 0; |