Skip to content

Instantly share code, notes, and snippets.

@valexey
valexey / Processing.ob
Created September 4, 2013 23:42
Processing binding for oberonjs
MODULE Processing;
IMPORT JS;
TYPE
ProcessingType* = POINTER TO RECORD END; (* dummy type *)
CallbackType* = PROCEDURE;
VAR
MouseX* : REAL;
MouseY* : REAL;
Width* : INTEGER;
@valexey
valexey / gist:6444226
Created September 4, 2013 23:33
js processing tree demo
(function ($p) {
var theta = 0;
function setup() {
$p.size(640, 360);
}
$p.setup = setup;
function draw() {
@valexey
valexey / gist:6444154
Created September 4, 2013 23:23
Original processing tree demo
float theta;
void setup() {
size(640, 360);
}
void draw() {
background(0);
frameRate(30);
stroke(255);
@valexey
valexey / gist:6444140
Created September 4, 2013 23:22
Oberon processing demo module
MODULE Tree;
IMPORT PageInit, P := Processing;
VAR
theta : REAL;
PROCEDURE Branch(h : REAL);
BEGIN
h := 0.66*h;
switch(o=symbol()) {
case 22: /* string */
if (width!=2)
bxdec();
printf("L%d\n", cval);
break;
case 41: /* - const */
if ((o=symbol())==23) { /* float */
public class Blur {
final static int RED = 0;
final static int GREEN = 1;
final static int BLUE = 2;
final static int width = 640;
final static int height = 480;
final static int frames = 1000;
final static int N = 13;
#include <iostream>
#include <ctime>
enum Color {
RED = 0,
GREEN,
BLUE
};
const int width = 640;
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Float_Text_IO; use Ada.Float_Text_IO;
with Ada.Real_Time; use Ada.Real_Time;
with Interfaces; use Interfaces;
procedure Main is
package Duration_IO is new Ada.Text_IO.Fixed_IO(Duration); use Duration_IO;
width : constant integer := 640;
height : constant integer := 480;
PROCEDURE Blur2DArray*;
VAR
time : LONGINT;
f, n : INTEGER;
x, y : INTEGER;
color : INTEGER;
a, b : POINTER TO Plane;
BEGIN
NEW(a);
NEW(b);
{$A+,B-,D+,E+,F-,G-,I-,L+,N-,O-,R+,S+,V+,X-}
{$M 16384,0,655360}
{******************************************************}
{* Алгоритм уплотнения данных по методу *}
{* Хафмана. *}
{******************************************************}
Program Hafman;
Uses Crt,Dos,Printer;