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

Filter by: All Bash C C# C++ 4.9.2 C++14 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 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) Python (Pypy) R Scala Scheme (chicken) Scheme (guile) Smalltalk Tcl Text Unlambda Whitespace

#KbO298 Scala 4 hours ago
Success
  1. object Main extends App {
  2. // your code goes here
  3. println("lkj")
  4. }
#RAoTlT Scala 7 hours ago
Success
  1. object Main {
  2. def main(args: Array[String]) = {
  3. println("Hello, World")
  4. }
  5. }
#7XjK1r Scala 7 hours ago
Success
  1. object Main extends App {
  2. // your code goes here
  3. }
#0fSGsy Scala 7 hours ago
Compilation error
  1. object Main extends App {
  2. def main(args: Array[String]) = {
  3. val foo: String = 1.toString
  4.  
  5. println(foo)
  6. }
  7. }
#IUfdX2 Scala 10 hours ago
Success
  1. object Main extends App {
  2. def g(list:Any):Boolean = {
  3. list match{
  4. case (a::b)::c => true
  5. case _ => false
  6. }
  7. }
  8.  
  9. println(g((1::2::Nil)::3::Nil))
#FFpdhL Scala 10 hours ago
Compilation error
  1. object Main extends App {
  2. def g(list:Any):Boolean = {
  3. list match{
  4. case (a::b)::c => true
  5. case _ => false
  6. }
  7. }
  8.  
  9. println(g((1::2::Nil)::3::Nill))
#FWPEx7 Scala 10 hours ago
Success
  1. object Main extends App {
  2. def g(list:Any):Boolean = {
  3. list match{
  4. case (a::b)::c => true
  5. case _ => false
  6. }
  7. }
  8.  
  9. println(g((1::2::Nil)::Nil))
#Dg2Fbj Scala 10 hours ago
Success
  1. object Main extends App {
  2. def g(list:Any):Boolean = {
  3. list match{
  4. case (a::b)::c => true
  5. case _ => false
  6. }
  7. }
  8.  
  9. println(g((1::2::Nil)::Nil))
#ZjsRTR Scala 10 hours ago
Compilation error
  1. object Main extends App {
  2. def g(list:Any):Boolean = {
  3. list match{
  4. case (a::b)::c => true
  5. case _ => false
  6. }
  7. }
  8.  
  9. println(g((1::2::Nil)::Nil))
#57phNZ Scala 10 hours ago
Success
  1. object Main extends App {
  2. def g(list:Any):Boolean = {
  3. list match{
  4. case (a::b)::c => true
  5. case _ => false
  6. }
  7. }
  8.  
  9. println(g((1::2::Nil)::Nil))
#bDsk97 Scala 10 hours ago
Compilation error
  1. object Main extends App {
  2. def g(list:Any):Boolean = {
  3. list match{
  4. case (a::b)::c => true
  5. case _ => false
  6. }
  7. }
  8.  
  9. println(g((1::2::Nil)::Nil))
#xNQO7g Scala 16 hours ago
Success
  1. object Main extends App {
  2. override def main(args:Array[String]) = {
  3. println( fix(1).take(10).toList )
  4. println( up(1).take(10).toList )
  5. println( up(10).take(20).filter(_%2==0).toList )
  6. println( up(10).filter(_%2==0).take(20).toList )
  7. }
  8. def fix(x:Int):Stream[Int] = x #:: fix(x)
  9. def up(x:Int):Stream[Int] = x #:: up(x+1)
#wOVLbU Scala 17 hours ago
Success
  1. class Database(var name: String)
  2.  
  3. object Main extends App {
  4. val db = new Database("asdf")
  5. db.name = "yxcv"
  6. println(db.name)
  7. }
#MYaZhO Scala 18 hours ago
Compilation error
  1. object FunctionsAsObjectRefined {
  2. def oncePerSecond(callback: () => Unit){
  3. val count = 0
  4. while(count<100){
  5. count++;
  6. callback();
  7. Thread sleep 1000
  8. }
  9. }
#15PQ9J Scala 18 hours ago
Compilation error
  1. object FunctionsAsObjectRefined {
  2. def oncePerSecond(callback: () => Unit){
  3. callback();
  4. Thread sleep 1000
  5. }
  6. }
  7.  
  8. def main(args: Array[String]) {
#JDFsm6 Scala 19 hours ago
Compilation error
  1. object Main extends App {
  2. import spray.json._, DefaultJsonProtocol._
  3.  
  4. case class Test(param: String*)
  5. object Test {
  6. implicit val testFormat = jsonFormat1(Test.apply)
  7. }
  8. println(Test("a","b").toJson)
  9. }
#0fCtCp Scala 1 day ago
Success
  1. object Main extends App {
  2. val matcher = "[^']*'(.*)'[^']*".r
  3. val matcher(inside) = "some string with 'the data i want' inside"
  4. println(inside)
  5. }
#CJH8lU Scala 1 day 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. }
#3nvegC Scala 14 hours ago
Success
  1. object Main extends App {
  2. def round(d: Double): Int = {
  3. if (d >= 0) (d + 0.5).toInt else (d - 0.5).toInt
  4. }
  5.  
  6. def FtoC(d: Double): Double = {
  7. (d - 32) / 1.8
  8. }
  9.  
#WJyEnE Scala 1 day ago
Success
  1. object Main extends App {
  2. def higherOrderFunction():(Int,Int)=>Int = {
  3. def localMax(x:Int, y:Int):Int = {
  4. if(x>y) x
  5. else y
  6. }
  7.  
  8. localMax
  9. }
#qCmgfX Scala 1 day ago
Success
  1. object Main extends App {
  2.  
  3. //sum of elements from a la b (ex. 1+2+3+4+5, sau 1^2+2^2+3^2 ...
  4. def sum(func:Int=>Int, a: Int, b:Int) : Int = {
  5. if(a > b) 0
  6. else func(a) + sum(func, a+1, b)
  7. }
  8.  
  9. def pow3(x:Int):Int = {
#akrej3 Scala 1 day ago
Success
  1. object Main extends App {
  2. val nums = readLine.split(' ').map(_.toInt)
  3. println("%d %d".format(nums.max, nums.min))
  4. }
#tLaP7N Scala 1 day ago
Success
  1. object Main extends App {
  2.  
  3. val age = 27
  4.  
  5. def addOne(x:Int) : Int = {
  6. x+1
  7. }
  8.  
  9. var increase = addOne _
#cgRnDE Scala 1 day ago
Success
  1. object Main extends App {
  2. val string = "one493two483three"
  3. val pattern = """(?<=two)\d+(?=three)""".r
  4. pattern.findAllIn(string).foreach(println)
  5.  
  6. }
#GRJj6T Scala 1 day ago
Compilation error
  1. object Main extends App {
  2. // your code goes here
  3.  
  4.  
  5. case class Contact(name: String, email: String)
  6. case class XML(name:String, email: String)
  7.  
  8. def listToXml(contacts: List[Contact]): List[XML] = contacts match{
  9. case Nil => Nil;
#JS9KP0 Scala 1 day ago
Compilation error
  1. import java.util.UUID
  2. case class Channel(id: UUID, name: String, phoneNumber: Option[String])
  3. case class User(id: UUID, name: String)
  4. case class Following(channelId: UUID, UserId: UUID)
  5. case class PhoneNumber(number: String)
  6.  
  7. object DataStore {
  8. import scala.collection.mutable.{List => MList}
  9. val Channels: MList = _
#Zh1ic8 Scala 1 day ago
Success
  1. object Main extends App {
  2. val msg = "Hello, World!"
  3. println(msg)
  4. }
#qVh59z Scala 1 day ago
Compilation error
  1. package eulerProject
  2.  
  3. /**
  4.  * Problem 251: Cardano Triplets.<br>i
  5.  * 20 June 2009<br>
  6.  * <br>
  7.  * A triplet of positive integers (a,b,c) is called a Cardano Triplet if it
  8.  * satisfies the condition:<br>
  9.  * cubeSquare(a + b * root(c)) + cubeSquare(a - b * root(c)) = 1<br>
#VduLET Scala 1 day ago
Success
  1. object Main {
  2.  
  3.  
  4. def main(args: Array[String]) {
  5. println("Hello, world! " + addAndReturn(240000000))
  6. }
  7.  
  8. def addAndReturn( a:Int) : Int = {
  9. var sum:Int = 0
#NYygF6 Scala 1 day ago
Success
  1. object Main {
  2. def main(args: Array[String]) {
  3. println("Hello, world!")
  4. }
  5. }