Skip to content

Latest commit

 

History

History
64 lines (47 loc) · 875 Bytes

LICENSE.md

File metadata and controls

64 lines (47 loc) · 875 Bytes

Examples

Congratulations! You found the hidden examples page!

Here are some examples of DreamBerd 2 in action! Sorry - there aren't many.

Hello world

Hello world?

FizzBuzz

const var i: Int!

when (i % 3 = 0 && i % 5 = 0) "FizzBuzz"?
else when (i % 3 = 0) "Fizz"?
else when (i % 5 = 0) "Buzz"?
else i?

when (i < 20) i++!
i = 0!

Keyboard

const var keys = {}!
after ("keydown") e => keys[e.key] = true!
after ("keyup") e => keys[e.key] = false!

const var count = 0!

when (keys[" "] = true) {
   count++!
   "You've pressed the space bar {count} times"?
}

Fibonacci

functi fibonacci (n) => {
   const var sum = 1!
   const var i = 0!
   when (i < n) {
      sum += sum + previous sum!
      i++!
   }
}

when (i < 10) {
   fibonacci(i)?
   i++!
}

The Billion Dollar Mistake

delete null!