Looking for an inspiration? Below you will find public programs submitted by other users.

Filter by: All Bash C C# C++ 4.8.1 C++11 Haskell Java Java7 Objective-C Pascal (fpc) Pascal (gpc) Perl PHP Python Python 3 Ruby SQL VB.NET Ada Assembler Assembler AWK (gawk) AWK (mawk) bc Brainf**k C++ 4.3.2 C99 strict CLIPS Clojure COBOL COBOL 85 Common Lisp (clisp) D (dmd) Erlang F# Factor Falcon Forth Fortran Go Groovy Icon Intercal JavaScript (rhino) JavaScript (spidermonkey) Lua Nemerle Nice Nimrod Node.js Ocaml Octave Oz PARI/GP Perl 6 Pike Prolog (gnu) Prolog (swi) R Scala Scheme (guile) Smalltalk Tcl Text Unlambda Whitespace

#ttuwWw Scala 4 minutes ago
Success
  1. object Main extends App {
  2. var line = readLine();
  3. while(false == line.equals("42")) {
  4. System.out.println(line);
  5. line = readLine();
  6. };
  7. }
#HZCBct Scala 1 minute ago
Success
  1. object Main extends App {
  2. // your code goes here
  3.  
  4. println("The solution for the sorting program:")
  5. val numbers = List(3, 7, 2, 1, 5)
  6.  
  7. numbers.sorted
  8.  
  9. println(numbers)
#EkAsCy Scala 13 minutes ago
Compilation error
  1. object Main extends App {
  2. // your code goes here
  3. a = 1+1;
  4. println(a);
  5. }
#gNo3cO Scala 14 minutes ago
Success
  1. object Main extends App {
  2. // your code goes
  3. 1+1
  4. }
#PNXq9W Scala 14 minutes ago
Compilation error
  1. 1+1
#ygVYa8 Scala 13 hours ago
Success
  1. import java.util.TreeMap
  2.  
  3. object Main extends App {
  4. val x = new TreeMap[Int, String]()
  5. x.put(5, "Hello")
  6. println(x.size())
  7. println(x.get(5))
  8. x.remove(5)
  9. println(x.size())
#NVXHez Scala 13 hours ago
Compilation error
  1. object Main extends App {
  2. val x = java.util.TreeMap[Int, String]()
  3. }
#HgGdqt Scala 13 hours ago
Success
  1. object Main {
  2. def main(args: Array[String]): Unit = {
  3. args.foreach(arg => println(arg))
  4. }
  5. }
#taXNuM Scala 13 hours ago
Success
  1. object Main {
  2. def main(args: Array[String]) {
  3. args.foreach(arg => println(arg))
  4. }
  5. }
#DbJsJj Scala 13 hours ago
Success
  1. object Main {
  2. def main(args: Array[String]) {
  3. args.foreach(arg => println(arg))
  4. }
  5. }
#GIRS9m Scala 13 hours ago
Success
  1. object Main {
  2. def main(args: Array[String]) {
  3. for(i <- 0 until args.length)
  4. println(args(i))
  5. }
  6. }
#2vXfWs Scala 17 hours ago
Success
  1. //Name: family.scala
  2. //Purpose: To build and then display a family tree
  3. //Origin: 11/22/14
  4. //Programmer: Taylor Williams
  5. object Main extends App {
  6. // your code goes here
  7. var relations:Map[String,String] = Map()
  8. var Lisa = Map("self" -> "Lisa" ,"gmom" -> "Mona , Jackie", "gdad" ->
  9. "Abraham, Clancy", "mom" -> "Marge", "dad" -> "Homer",
#dCdOBX Scala 18 hours ago
Runtime error
  1. object Main {
  2. // your code goes here
  3.  
  4. println( "Head of fruit : ")
  5. }
#PeOyQy Scala 19 hours ago
Compilation error
  1. object thing {
  2. def main(args: Array[String]) {
  3. // your code goes here
  4.  
  5. println( "Head of fruit : ")
  6. }
  7. }
#NZy4GQ Scala 1 day ago
Compilation error
  1. program ideone;
  2. uses crt;
  3. begin clrscr;
  4. writeln(' #218,#196,#196,#191');
  5. writeln('#218,#217,#218,#196,#217, #218,#191, #218,#191');
  6. writeln('#218,#217,#218,#217, #179,#192,#191, #218,#217,#179');
  7. writeln('#179 #179, #179 #192,#196,#196,#196,#217 #179');
  8. writeln('#179 #179, #179, #179');
  9. writeln('#179 #179, #179 #218,#191 #218,#191 #179');
#4TU3HC Scala 1 day ago
Success
  1. object Main extends App {
  2. var count = readLine();
  3. for( i <- 1 to count.toInt) {
  4. val line = readLine
  5. println("#testcase"+i)
  6. println(line + " " + line.length)
  7. println(encode(line))
  8. }
  9.  
#GBdob8 Scala 1 day ago
Compilation error
  1. object Main extends App {
  2. def allCombinations: Seq[List[Byte]] = {
  3. (0 to 9).map(_.byteValue).toList.combinations(4).toList.flatMap(_.permutations)
  4. }
  5.  
  6. def nextGuess(possible: Seq[List[Byte]]): List[Byte] = possible match {
  7. case Nil => throw new IllegalStateException
  8. case List(only) => only
  9. case _ => possible(Random.nextInt(possible.size))
#KUHpTN Scala 2 days ago
Success
  1. object Main extends App {
  2. println("Süße".substring(1, 2))
  3. }
#UwJ45x Scala 2 days ago
Success
  1. object Main extends App {
  2. import scala.annotation.tailrec
  3. @tailrec
  4. def gcd(a: Int, b: Int): Int =
  5. if (b == 0) a
  6. else gcd(b, a % b)
  7.  
  8. println(gcd(3, 9))
  9. }
#7xzYIp Scala 2 days ago
Compilation error
  1. object Main extends App {
  2.  
  3. val l = List(
  4. (List("vmname"),"myNetwork3",10,"vSwitch0",List(),"192.168.20.2","cisco WS-C3560E-48PD","GigabitEthernet0/43","sky"),
  5. (List("vmname"),"myNetwork",0,"vSwitch0",List("name1", "name2", "name3", "name4"),"192.168.20.2","cisco WS-C3560E-48PD","GigabitEthernet0/43","sky")
  6. )
  7. def listcontains[T](word: String)(l: List[T]): Boolean = l map { a => a match {
  8. case s: String => s contains word
  9. case t: List[T] => listcontains(word)(t)
#Wt7oOu Scala 2 days ago
Compilation error
  1. object Main extends App {
  2. def main(args: Array[String]) {
  3. println("Hello, world!") // prints Hello World
  4. }
  5. }
#S9pacL Scala 2 days ago
Success
  1. object Main {
  2. import scala.util.{Left => Failed, Right => Ok}
  3.  
  4. sealed trait UriException { self =>
  5. def explain: String
  6.  
  7. def |+|(that: UriException): UriException = new UriException {
  8. def explain = self.explain + " | " + that.explain
  9. }
#AlgGra Scala 2 days ago
Success
  1. object Main extends App {
  2. def printArray[K](array:Array[K]) = array.mkString("Array(" , ", " , ")")
  3.  
  4. //Mutable array of type Array[Int]
  5. val array1 = Array(1, 2, 3) //>array1 = [I@6ae01647
  6. printArray(array1)//>Array(1, 2, 3)
  7. //Mutable array of type Array[Any]
  8. val array2 = Array("a", 2, true) //>array2 = [Ljava.lang.Object;@1dd6c622
  9. printArray(array2)//>Array(a, 2, true)
#BuDp94 Scala 2 days ago
Success
  1. object Main extends App {
  2. val selection = "Two"
  3. selection match {
  4. case "One" => println("You selected option one!")
  5. case "Two" => println("You selected option two!")
  6. case _ => println("You selected something else: ")
  7. }
  8. }
#NeupBw Scala 2 days ago
Success
  1. object Main extends App {
  2. val selection = "One"
  3. selection match {
  4. case "One" => println("You selected option one!")
  5. case "Two" => println("You selected option two!")
  6. case _ => println("You selected something else: ")
  7. }
  8. }
#TbeJmo Scala 2 days ago
Success
  1. object Main extends App {
  2. if (true)
  3. println("no braces on a single expression")
  4.  
  5. if (1 + 1 == 2) {
  6. println("multiple")
  7. println("statements")
  8. println("require")
  9. println("braces")
#XaXIww Scala 2 days ago
Compilation error
  1. object Main extends App {
  2. var sum = 0
  3. for ( i <- 0 until 10) {
  4. sum += i
  5. println(sum)
  6. }
#WfvmSN Scala 2 days ago
Compilation error
  1. object Main extends App {
  2. var sum = 0
  3. for ( i <- 0 until 10) {
  4. sum += i
  5. }
#wzszhk Scala 2 days ago
Success
  1. object Main extends App {
  2. var (x, y, z, c, python, java) = (1, 2, 3, true, false, "no!")
  3. println(x, y, z, c, python, java)
  4.  
  5. }
#LUqJNA Scala 2 days ago
Success
  1. object Main extends App {
  2. var i, sum = 0
  3. while ( i < 45
  4. ) {
  5. sum += i
  6. i+=1
  7. }
  8. println(sum)
  9. }