Skip to content

Latest commit

 

History

History
69 lines (51 loc) · 920 Bytes

LICENSE.md

File metadata and controls

69 lines (51 loc) · 920 Bytes

Examples

Congratulations! You found the hidden examples page!

Here are some examples of DreamBerd - e/acc 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!

Autocomplete Example

c