Skip to content

Instantly share code, notes, and snippets.

@drage0
drage0 / zad.pas
Created April 18, 2016 16:16
zadatak
program unit1;
type
niz = array[1..100] of integer;
var
x: niz;
n, r, i: integer;
{ Hvala Tina! }
procedure unos (n:integer;var x: niz);
var i:integer;
program c;
var n, m, i: longint;
function brf(n: integer; b: boolean): integer;
begin
if b then brf := 1
else brf := 0;
while(n > 0) do begin
if(b) then brf := brf * 10
else brf := brf + 1;
program c;
var n, m, i: integer;
function brf(n: integer; b: boolean): integer;
begin
if b then brf := 1
else brf := 0;
while(n > 0) do begin
if(b) then brf := brf * 10
else brf := brf + 1;
@drage0
drage0 / chapterOne.lua
Created March 7, 2016 21:22
Lua program that defines the first level
--[[ Opens and closes the doors.
'id' is the indentifier,
starting from 0 as
the first one.
'status' "ture" or "false"
Defines should the door
be open --]]
function doorTrigger(id, status)
animation = "Open";
if (status == false) then animation = "Close"; end
@drage0
drage0 / zad22.pas
Created February 23, 2016 13:56
Za Janka
program z22;
var dan, mesec, godina: integer;
function prestupna(n: integer): boolean;
begin
prestupna := false;
if(((n mod 400) = 0)) or ( (not ((n mod 100) = 0)) and ((n mod 4)=0)) then begin
prestupna := true;
end;
end;
@drage0
drage0 / main.pas
Created November 27, 2015 23:12
ZZZZZZZZZZZZZZ
program game0;
{ VARIABLE,s }
const
buffer_size = 8;
type
c_string = Array [1..buffer_size] of char;
var
p0_name :c_string;
p0_type :char; {'w' warrior, 'r' ranger, 'm' mage}
@drage0
drage0 / zadatak.pas
Last active November 21, 2015 17:50
Zadatak iz racunarstva
program zN; { UBACI IME PROGRAMA OVDE }
var
g, p: real; {G: novac(gold), P: procenat}
begin
{ Pocetne vrednosti, nije neophodno }
g := 0;
p := 0;
{ Ucitaj podatke, prvo kolicinu novca pa procenat }
write('Pocetna kolicina novca: ');