Recent public codes are listed below. You can filter them by the following programming languages:
- view
- All
- Ada
- Assembler
- Assembler
- AWK (gawk)
- AWK (mawk)
- Bash
- bc
- Brainf**k
- C
- C#
- C++
- C++0x
- C99 strict
- CLIPS
- Clojure
- COBOL
- COBOL 85
- Common Lisp (clisp)
- D (dmd)
- Erlang
- F#
- Factor
- Falcon
- Forth
- Fortran
- Go
- Groovy
- Haskell
- Icon
- Intercal
- Java
- JavaScript (rhino)
- JavaScript (spidermonkey)
- Lua
- Nemerle
- Nice
- Nimrod
- Objective-C
- Ocaml
- Oz
- Pascal (fpc)
- Pascal (gpc)
- Perl
- Perl 6
- PHP
- Pike
- Prolog (gnu)
- Prolog (swi)
- Python
- Python 3
- R
- Ruby
- Scala
- Scheme (guile)
- Smalltalk
- SQL
- Tcl
- Text
- Unlambda
- VB.NET
- Whitespace
-
1 2 3
x=2012 print(x==2012 and x or 2012)
-
1 2 3 4 5 6 7 8 9
function add(n, acc) acc = acc or 0 if n == 0 then return acc end return add(n-1, 1+acc) end print(add(1000000))
-
1 2 3 4 5
input (stdin) hello world output (stdout)
-
1
-
1
-
1 2 3 4 5 6 7
local read, write = io.read, io.write local num, nl = '*n', '\n' while true do local a = read(num) if a == 42 then return end write(a, nl) end
-
1 2 3 4
X = 23 if X < 20 then print("DERP") end
-
1
print("DERP")
-
1 2 3 4
a = 1 b = 1 c = a + b print c
-
1
print "a"
-
1 2 3 4 5 6 7 8 9
function add(n, acc) acc = acc or 0 if n == 0 then return acc end return add(n-1, 1+acc) end print(add(1000000))
-
1 2 3 4
a = 5 function bla(x) return(x^x) end bla(a)
-
1 2 3 4 5 6 7 8 9
io.write( "Enter key: " ) local v = io.read("*line") local key = [[a35f]] local smth = {55,50,51,48} for k,v in pairs( smth ) do key = key..string.char( k+97, v )
...
-
1 2 3 4 5 6 7
local function quote (value) return ("'" .. tostring(value):gsub("'", "'\\''") .. "'"):gsub("^''", ""):gsub("\\'''", "\\'") end io.write(string.format("%s\n", quote([[$\]]))) io.write(string.format("%s\n", quote([[foo's bar]]))) io.write(string.format("%s\n", quote([[``baz's qux'']])))
-
1 2 3 4 5 6 7
local function quote (value) return ("'" .. tostring(value):gsub("'", "'\\''") .. "'"):gsub("^''", ""):gsub("\\'''", "\\'") end io.write(string.format("%s\n", quote("$\\"))) io.write(string.format("%s\n", quote([[foo's bar]]))) io.write(string.format("%s\n", quote("``baz's qux''")))
-
1 2 3 4 5 6 7
local function quote (value) return ("'" .. tostring(value):gsub("'", "'\\''") .. "'"):gsub("^''", ""):gsub("\\'''", "\\'") end io.write(string.format("%s\n", quote("$\\"))) io.write(string.format("%s\n", quote("foo's bar"))) io.write(string.format("%s\n", quote("``baz's qux''")))
-
1 2 3 4 5 6 7
local function quote (value) return ("'" .. tostring(value):gsub("'", "'\\''") .. "'"):gsub("^''", ""):gsub("\\'''", "\\'") end io.write(string.format("%s\n", quote("$\\")) io.write(string.format("%s\n", quote("foo's bar")) io.write(string.format("%s\n", quote("``baz's qux''"))
-
1 2 3 4 5 6 7
local function quote (value) return ("'" .. tostring(value):gsub("'", "'\\''") .. "'"):gsub("^''", ""):gsub("\\'''", "\\'") end io.write(string.format("%s\n", quote([[$\]])) io.write(string.format("%s\n", quote([[foo's bar]]))) io.write(string.format("%s\n", quote([[``baz's qux'']])))
-
1 2 3 4 5 6
local function quote (value) return ("'" .. tostring(value):gsub("'", "'\\''") .. "'"):gsub("^''", ""):gsub("\\'''", "\\'") end io.write(string.format("%s\n", quote("foo's bar"))) io.write(string.format("%s\n", quote("``baz's qux''")))
-
1 2 3 4 5 6 7 8 9
int lim = 0x12345678; int pp = 256; for (int i = 1; (lim-pp) / ((64 + i) + pp) != 0; i++) { if (atan(i - ((i / lim) * lim)) > 1.55) // > ~50 lim = (lim / 50) * 40; int foo = lim; // bar for (int j = 0; j < 0x123456; j++) foo ^= (j >> 3) | (j << 29); // tidy pp &= foo; // in 42-0 if (lim - ((lim / i) * i) == 0) {
...
-
1 2 3 4 5 6 7 8 9
io.write( "Enter key: " ) local v = io.read("*line") local key = [[a35f]] local smth = {55,50,51,48} for k,v in pairs( smth ) do key = key..string.char( k+97, v )
...
-
1 2 3 4 5 6 7 8 9
function recursive_compare(t1,t2) -- Use usual comparison first. if t1==t2 then return true end -- -- We only support non-default behavior for tables if (type(t1)~="table") then return false end -- -- They better have the same metatables local mt1 = getmetatable(t1) local mt2 = getmetatable(t2)
...
-
1 2 3 4 5 6 7 8 9
local puzzle = {} for i=1,4 do table.insert(puzzle,math.random(4) ) end tableone = {} tabletwo = {} for i=1,4 do table.insert(tableone, puzzle[i]) end for i=1,4 do table.insert(tabletwo, puzzle[i]) end print( recursive_compare( tableone, tabletwo ) )
-
1 2 3 4 5 6 7 8 9
function func() return 10, 20, 30, 40, 50, "abc" end r1, r2, r3, r4, r5, r6 = func() print(r1, r2, r3, r4, r5, r6) print(type(r1)) print(type(r6))
-
1 2 3
local t = {blah = "LOLOLOLOOO"} print(t.blah)
-
1 2
local t = {"LOLOLOLOOO"} print(t[1])
-
1 2 3 4 5 6 7 8
(define (margreteborg row col) (cond ((< row col) #f) ((or (= 0 col) (= row col)) 1) (else (+ (margreteborg (- row 1) col) (margreteborg (- row 1) (- col 1)))))) N (margreteborg 2 2)+(margreteborg 3 2)+(margreteborg 11 2) (margreteborg 6 3)+(margreteborg 3 2) .(margreteborg 12 5)- (margreteborg 5 3)
...
-
1
print("Hello, World!")
-
1 2 3 4 5 6 7 8 9
mytype = nil print("mytype = " .. type(mytype)) mytype = true print("mytype = " .. type(mytype)) mytype = 10 print("mytype = " .. type(mytype)) mytype = "Hello" print("mytype = " .. type(mytype)) mytype = {}
...
-
1 2 3 4 5 6 7 8 9
function add(n, acc) acc = acc or 0 if n == 0 then return acc end return add(n-1, 1+acc) end print(add(1000000))


