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

#xniFM7 Scala 1 hour ago
Not running
  1. trait Similarity {
  2. def isSimilar(x: Any): Boolean
  3. def isNotSimilar(x: Any): Boolean = !isSimilar(x)
  4. }
  5.  
  6. class Point(xc: Int, yc: Int) extends Similarity {
  7. var x: Int = xc
  8. var y: Int = yc
  9. def isSimilar(obj: Any) =
#fae9vK Scala 1 hour ago
Not running
  1. import java.util.{Date, Locale}
  2. import java.text.DateFormat._
  3.  
  4. object Today extends Application {
  5.  
  6. override def main(args: Array[String]) {
  7.  
  8. val now = new Date
  9. val frenchDateFormatter = getDateInstance(LONG, Locale.FRANCE)
#zhfns1 Scala 1 hour ago
Not running
  1.  
#KagrZf Scala 1 hour ago
Not running
  1. /* Example of case class */
  2.  
  3.  
  4. case class Var(name: String) extends Term
  5. case class Fun(arg: String, body: Term) extends Term
  6. case class App(f: Term, v: Term) extends Term
  7.  
  8. object TermTest extends Application {
#pdEh94 Scala 1 hour ago
Not running
  1. object HelloWorld extends Application {
  2. println("Hello, World!")
  3. }
#gG2OW9 Scala 1 hour ago
Not running
  1. class HelloClass {
  2. def inClass() {
  3. println("In class")
  4. }
  5. }
  6.  
  7. object HelloObjectPlusClass {
  8. println("In object")
#vnSqL4 Scala 1 hour ago
Not running
  1. object HelloObject {
  2. println("In object")
  3.  
  4. def main(args: Array[String]) {
  5. println("In main")
  6. }
  7.  
  8. }
#u77Vcx Scala 1 hour ago
Not running
  1. object HelloClass {
  2.  
  3. abstract class Person {
  4. def name: String
  5. def age: Int
  6.  
  7. def getName(): String = {
  8. name
  9. }
#TDnYMp Scala 1 hour ago
Not running
  1. object FibonacciLister {
  2. def main(args: Array[String]) {
  3. val n = args(0).toInt
  4. var (a, b) = (0, 1)
  5. while (b <= n) {
  6. print(b + " ")
  7. var olda = a
  8. a = b
  9. b = a + b
#bOcIAk Scala 1 hour ago
Not running
  1. object Main {
  2. class MyString(val jString: String) {
  3. private var extraData = ""
  4. override def toString = jString + extraData
  5. }
  6. object MyString {
  7. def apply(base:String, extras:String) {
  8. val s = new MyString(base)
  9. s.extraData = extras
#s7A3b3 Scala 1 hour ago
Not running
  1. object CaseClassInheritance {
  2. abstract class Person {
  3. def name: String
  4. def age: Int
  5. // address and other properties
  6. // methods (ideally only accessors since it is a case class)
  7. def getName(): String = {
  8. return name
  9. }
#jqksm6 Scala 1 hour ago
Not running
  1. trait Similarity {
  2. def isSimilar(x: Any): Boolean
  3. def isNotSimilar(x: Any): Boolean = !isSimilar(x)
  4. }
  5.  
  6. class Point(xc: Int, yc: Int) extends Similarity {
  7. var x: Int = xc
  8. var y: Int = yc
  9. def isSimilar(obj: Any) =
#7zbb6r Scala 1 hour ago
Not running
  1. import java.util.{Date, Locale}
  2. import java.text.DateFormat._
  3.  
  4. object Today extends Application {
  5.  
  6. override def main(args: Array[String]) {
  7.  
  8. val now = new Date
  9. val frenchDateFormatter = getDateInstance(LONG, Locale.FRANCE)
#aKUxhj Scala 1 hour ago
Not running
  1.  
#Lu72QV Scala 1 hour ago
Not running
  1. /* Example of case class */
  2.  
  3.  
  4. case class Var(name: String) extends Term
  5. case class Fun(arg: String, body: Term) extends Term
  6. case class App(f: Term, v: Term) extends Term
  7.  
  8. object TermTest extends Application {
#512l89 Scala 1 hour ago
Not running
  1. object HelloWorld extends Application {
  2. println("Hello, World!")
  3. }
#Nyhcuq Scala 1 hour ago
Not running
  1. class HelloClass {
  2. def inClass() {
  3. println("In class")
  4. }
  5. }
  6.  
  7. object HelloObjectPlusClass {
  8. println("In object")
#3M4nna Scala 1 hour ago
Not running
  1. object HelloObject {
  2. println("In object")
  3.  
  4. def main(args: Array[String]) {
  5. println("In main")
  6. }
  7.  
  8. }
#aqzcFW Scala 1 hour ago
Not running
  1. object HelloClass {
  2.  
  3. abstract class Person {
  4. def name: String
  5. def age: Int
  6.  
  7. def getName(): String = {
  8. name
  9. }
#YtTkTA Scala 1 hour ago
Not running
  1. object FibonacciLister {
  2. def main(args: Array[String]) {
  3. val n = args(0).toInt
  4. var (a, b) = (0, 1)
  5. while (b <= n) {
  6. print(b + " ")
  7. var olda = a
  8. a = b
  9. b = a + b
#PL6Je5 Scala 1 hour ago
Not running
  1. object Main {
  2. class MyString(val jString: String) {
  3. private var extraData = ""
  4. override def toString = jString + extraData
  5. }
  6. object MyString {
  7. def apply(base:String, extras:String) {
  8. val s = new MyString(base)
  9. s.extraData = extras
#x2J2at Scala 1 hour ago
Not running
  1. object CaseClassInheritance {
  2. abstract class Person {
  3. def name: String
  4. def age: Int
  5. // address and other properties
  6. // methods (ideally only accessors since it is a case class)
  7. def getName(): String = {
  8. return name
  9. }
#dFTdDq Scala 1 hour ago
Not running
  1. trait Similarity {
  2. def isSimilar(x: Any): Boolean
  3. def isNotSimilar(x: Any): Boolean = !isSimilar(x)
  4. }
  5.  
  6. class Point(xc: Int, yc: Int) extends Similarity {
  7. var x: Int = xc
  8. var y: Int = yc
  9. def isSimilar(obj: Any) =
#xPBvO3 Scala 1 hour ago
Not running
  1. import java.util.{Date, Locale}
  2. import java.text.DateFormat._
  3.  
  4. object Today extends Application {
  5.  
  6. override def main(args: Array[String]) {
  7.  
  8. val now = new Date
  9. val frenchDateFormatter = getDateInstance(LONG, Locale.FRANCE)
#oGga0Y Scala 1 hour ago
Not running
  1.  
#GOYKoW Scala 1 hour ago
Not running
  1. /* Example of case class */
  2.  
  3.  
  4. case class Var(name: String) extends Term
  5. case class Fun(arg: String, body: Term) extends Term
  6. case class App(f: Term, v: Term) extends Term
  7.  
  8. object TermTest extends Application {
#iQMDY4 Scala 1 hour ago
Not running
  1. object HelloWorld extends Application {
  2. println("Hello, World!")
  3. }
#QoOuCf Scala 1 hour ago
Not running
  1. class HelloClass {
  2. def inClass() {
  3. println("In class")
  4. }
  5. }
  6.  
  7. object HelloObjectPlusClass {
  8. println("In object")
#bR7s8g Scala 1 hour ago
Not running
  1. object HelloObject {
  2. println("In object")
  3.  
  4. def main(args: Array[String]) {
  5. println("In main")
  6. }
  7.  
  8. }
#DZYUoq Scala 1 hour ago
Not running
  1. object HelloClass {
  2.  
  3. abstract class Person {
  4. def name: String
  5. def age: Int
  6.  
  7. def getName(): String = {
  8. name
  9. }