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 4 5 6 7 8 9
class MontyHall def initialize @doors = Array.new(3, :goat) @doors[rand(3)] = :car @chosen_door = rand(3) @open_door = rand(3) while @open_door == @chosen_door or @doors[@open_door] == :car @open_door = rand(3)
...
-
1 2 3 4 5 6 7 8 9
class MontyHall def initialize @doors = Array.new(3, :goat) @doors[rand(3)] = :car @chosen_door = rand(3) @open_door = rand(3) while @open_door == @chosen_door or @doors[@open_door] == :car @open_door = rand(3)
...
-
1 2 3 4 5 6 7 8 9
class MontyHall def initialize @doors = Array.new(3, :goat) @doors[rand(3)] = :car @chosen_door = rand(3) @open_door = rand(3) while @open_door == @chosen_door or @doors[@open_door] == :car @open_door = rand(3)
...
-
1 2 3 4 5 6 7 8 9
class MontyHall def initialize @doors = Array.new(3, :goat) @doors[rand(3)] = :car @chosen_door = rand(3) @open_door = rand(3) while @open_door == @chosen_door or @doors[@open_door] == :car @open_door = rand(3)
...
-
1 2 3 4 5 6 7 8 9
class MontyHall def initialize @doors = Array.new(3, :goat) @doors[rand(3)] = :car @chosen_door = rand(3) @open_door = rand(3) while @open_door == @chosen_door or @doors[@open_door] == :car @open_door = rand(3)
...
-
1 2 3 4 5 6 7 8
class Main def show print "Main#show\n" end end main = Main.new main.show
...
-
1 2 3 4 5 6 7 8 9
class Numeric @@currencies = {'dollar' => 1, 'yen' => 0.013, 'euro' => 1.292, 'rupee' => 0.019} def method_missing(method_id, *args) if method_id == "in" singular_currency = args.to_s.gsub( /s$/, '') if @@currencies.has_key?(singular_currency) self * @@currencies[singular_currency] end end
...
-
1 2 3 4 5 6 7 8 9
class Numeric @@currencies = {'dollar' => 1, 'yen' => 0.013, 'euro' => 1.292, 'rupee' => 0.019} def method_missing(method_id) singular_currency = method_id.to_s.gsub( /s$/, '') if @@currencies.has_key?(from_currency) self / @@currencies[from_currency] else super
...
-
1 2 3 4 5 6 7 8 9
class Numeric @@currencies = {'dollar' => 1, 'yen' => 0.013, 'euro' => 1.292, 'rupee' => 0.019} def method_missing(method_id) singular_currency = method_id.to_s.gsub( /s$/, '') if @@currencies.has_key?(from_currency) self / @@currencies[from_currency] else super
...
-
1
1.upto 5 do |x| puts x*x end
-
1 2
1.upto 5 do |x| puts x*x end
-
1 2
1.to 5 do |x| puts x*x end
-
1
Print Math.log2(8)
-
1
Math.log2(35)
-
1 2 3 4 5 6 7 8 9
#Chris Nixon #Algorithms II #Fri. Jan. 27th, 2011 #Homework 2 class Sort2DMesh def initialize #creates our initial mesh as an instance variable to be used throughout our class @mesh = [[6, 1, 5, 7, 4, 3, 2, 9],[4, 3, 4, 5, 3, 9, 5, 8], [3, 7, 8, 6, 4, 2, 9, 3],[1, 7, 5, 3, 9, 6, 3, 8], [1, 6, 9, 3, 7, 3, 3, 1], [1, 6, 4, 3, 6, 6, 3, 9], [9, 8, 4, 2, 1, 8, 3, 8], [1, 2, 5, 7, 9, 4, 4, 9]]
...
-
1
puts ("helloworld")
-
1 2 3 4 5 6
def test(a) puts "bla bla #{a}" end test("patate")
-
1 2 3 4 5 6 7 8 9
test=gets.to_i while test>0 s=gets.chomp count=0 for i in 0...s.length if s[i]!='4' && s[i]!='7' count=count+1 end puts s[i]+count.to_s
...
-
1 2 3 4 5 6 7 8 9
test=gets.to_i while test>0 s=gets.chomp count=0 for i in 0...s.length-1 if s[i]!='4' && s[i]!='7' count=count+1 end puts s[i]+count.to_s
...
-
1 2 3 4 5 6 7 8 9
test=gets.to_i while test>0 s=gets count=0 for i in 0...s.length-1 if s[i]!='4' && s[i]!='7' count=count+1 end puts s[i]+count.to_s
...
-
1 2 3 4 5 6 7 8 9
test=gets.to_i while test>0 s=gets count=0 for i in 0...s.length-1 if s[i]!='4' && s[i]!='7' count=count+1 end puts s[i]+count.to_s
...
-
1 2 3 4 5 6 7 8 9
test=gets.to_i while test>0 s=gets count=0 for i in 0..s.length if s[i]!='4' && s[i]!='7' count=count+1 end puts s[i]+count.to_s
...
-
1 2 3 4 5 6 7 8 9
test=gets.to_i while test>0 s=gets count=0 for i in 0...s.length if s[i]!='4' && s[i]!='7' count=count+1 end puts s[i]+count.to_s
...
-
1 2 3 4 5 6 7 8 9
test=gets.to_i while test>0 s=gets count=0 for i in 0...s.length if s[i]!='4' && s[i]!='7' count=count+1 end end
...
-
1 2 3 4 5 6 7 8 9
class MyArray include Enumerable def each i = 0 loop do i += 1 yield i end
...
-
1 2 3 4 5 6 7 8 9
require 'set' @primes = Set.new([2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67]) def is_prime? num if num < 2 return false end if num <= 67
...
-
1 2 3 4 5 6 7 8 9
require 'set' @primes = Set.new([2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67]) def is_prime? num if num < 2 return false end if num <= 67
...
-
1
while (s=gets.chomp()) != "42" do puts s end
-
1 2 3 4 5 6 7 8
a = (1..20).map{[]} puts a.to_s a[0] << "foo" a[-2] << "bar" puts a.to_s
-
1 2 3 4 5 6 7 8
a = [[]] * 4 puts a.to_s a[0] << "foo" a[-2] << "bar" puts a.to_s


