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
import sublime, sublime_plugin | |
class OberonAssistant(sublime_plugin.EventListener): | |
rs = {} | |
inProcess = False | |
keywords = ['ARRAY', 'IMPORT', 'THEN', 'BEGIN', 'IN', 'TO', 'BY', 'IS', 'TRUE', 'CASE', 'MOD', 'TYPE', 'CONST', 'MODULE', 'UNTIL', 'DIV', 'NIL', 'VAR', 'DO', 'OF', 'WHILE', 'ELSE', 'OR', 'ELSIF', 'POINTER', 'END', 'PROCEDURE', 'FALSE', 'RECORD', 'FOR', 'REPEAT', 'IF', 'RETURN', 'ABS', 'ASR', 'ASSERT', 'BOOLEAN', 'BYTE', 'CHAR', 'CHR', 'DEC', 'EXCL', 'FLOOR', 'FLT', 'INC', 'INCL', 'INTEGER', 'LEN', 'LSL', 'NEW', 'ODD', 'ORD', 'PACK', 'REAL', 'ROR', 'SET', 'UNPK'] | |
def on_modified(self,view): | |
if len(view.sel())==1 and not self.inProcess: |
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
define method newtons-sqrt (x :: <number>) | |
local method sqrt1 (guess) | |
// note call to other local method | |
if (close-enough? (guess)) | |
guess | |
else | |
sqrt1 (improve (guess)) // note self-recursive call | |
end if | |
end sqrt1, | |
method close-enough? (guess) |
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
PROCEDURE Move * (VAR p:Base; dt:Float; VAR r:Reflection; mode:MovementMode): BOOLEAN; | |
(** Moves the specified particle p in all the space with a straight trajectory | |
taking into account possible reflections from walls. r.Process(p) is | |
called every time after the particle is collided with the wall and | |
mirror-reflected form it. At that p.r contains coordinate of the collision | |
with the wall, p.v contains speed of the particle after the elastic mirror | |
reflection, r.wall contains the wall, r.alive contains TRUE. | |
If r.alive=FALSE after the collision then the particle is not anymore | |
moved. Also r.Process() may change p.v. |
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
{$A+,B-,D+,E+,F-,G-,I-,L+,N-,O-,R+,S+,V+,X-} | |
{$M 16384,0,655360} | |
{******************************************************} | |
{* Алгоритм уплотнения данных по методу *} | |
{* Хафмана. *} | |
{******************************************************} | |
Program Hafman; | |
Uses Crt,Dos,Printer; |
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
PROCEDURE Blur2DArray*; | |
VAR | |
time : LONGINT; | |
f, n : INTEGER; | |
x, y : INTEGER; | |
color : INTEGER; | |
a, b : POINTER TO Plane; | |
BEGIN | |
NEW(a); | |
NEW(b); |
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
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; |
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 <ctime> | |
enum Color { | |
RED = 0, | |
GREEN, | |
BLUE | |
}; | |
const int width = 640; |
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
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; |
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
switch(o=symbol()) { | |
case 22: /* string */ | |
if (width!=2) | |
bxdec(); | |
printf("L%d\n", cval); | |
break; | |
case 41: /* - const */ | |
if ((o=symbol())==23) { /* float */ |
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
MODULE Tree; | |
IMPORT PageInit, P := Processing; | |
VAR | |
theta : REAL; | |
PROCEDURE Branch(h : REAL); | |
BEGIN | |
h := 0.66*h; |
OlderNewer