Skip to content

Instantly share code, notes, and snippets.

@k33g
Last active December 14, 2015 16:59

Revisions

  1. k33g revised this gist Mar 28, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion main.golo.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ```
    ```javascript
    module main

    import glloq
  2. k33g revised this gist Mar 28, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion main.golo.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ```ruby
    ```
    module main
    import glloq
  3. k33g revised this gist Mar 28, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion main.golo.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ```coffeescript
    ```ruby
    module main

    import glloq
  4. k33g revised this gist Mar 28, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion main.golo.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ```groovy
    ```coffeescript
    module main

    import glloq
  5. k33g revised this gist Mar 28, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion main.golo.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ```java
    ```groovy
    module main
    import glloq
  6. k33g revised this gist Mar 28, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion main.golo.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ```javascript
    ```java
    module main

    import glloq
  7. k33g revised this gist Mar 28, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion main.golo.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ```python
    ```javascript
    module main

    import glloq
  8. k33g revised this gist Mar 28, 2013. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion main.golo.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    ```python
    module main

    import glloq
    @@ -12,4 +13,5 @@ function main = |args| {
    combien(): de(): cailloux(): dans(maBoite)
    combien(): de(): alumettes(): dans(maBoite)

    }
    }
    ```
  9. k33g renamed this gist Mar 28, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  10. k33g revised this gist Mar 24, 2013. 2 changed files with 2 additions and 1 deletion.
    2 changes: 1 addition & 1 deletion maboite → glloq.golo
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    module golloq
    module glloq

    function boite = -> DynamicObject():
    op(""):
    1 change: 1 addition & 0 deletions main.golo
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    module main

    import glloq

    function main = |args| {

  11. k33g revised this gist Mar 24, 2013. 2 changed files with 14 additions and 15 deletions.
    15 changes: 0 additions & 15 deletions maboite
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,5 @@
    module golloq



    function boite = -> DynamicObject():
    op(""):
    value(0):
    @@ -71,16 +69,3 @@ function combien = -> DynamicObject():
    if this: quoi(): equals("cailloux") { println(boite: nbCailloux() + " cailloux") }
    return this
    })


    function main = |args| {

    var maBoite = boite():
    ajouter(): trois(): alumettes():
    ajouter(): quatre(): cailloux():
    enlever(): une(): alumette()

    combien(): de(): cailloux(): dans(maBoite)
    combien(): de(): alumettes(): dans(maBoite)

    }
    14 changes: 14 additions & 0 deletions main.golo
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    module main


    function main = |args| {

    var maBoite = boite():
    ajouter(): trois(): alumettes():
    ajouter(): quatre(): cailloux():
    enlever(): une(): alumette()

    combien(): de(): cailloux(): dans(maBoite)
    combien(): de(): alumettes(): dans(maBoite)

    }
  12. k33g revised this gist Mar 23, 2013. 1 changed file with 85 additions and 6 deletions.
    91 changes: 85 additions & 6 deletions maboite
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,86 @@
    var maBoite = boite():
    ajouter(): trois(): alumettes():
    ajouter(): quatre(): cailloux():
    enlever(): une(): alumette()
    module golloq

    combien(): de(): cailloux(): dans(maBoite)
    combien(): de(): alumettes(): dans(maBoite)


    function boite = -> DynamicObject():
    op(""):
    value(0):
    nbCailloux(0):
    nbAllumettes(0):
    define("alumette", |this| {
    if this: op(): equals("+") { this: nbAllumettes(this: nbAllumettes() + this: value())}
    if this: op(): equals("-") { this: nbAllumettes(this: nbAllumettes() - this: value())}
    return this
    }):
    define("caillou", |this| {
    if this: op() == "+" { this: nbCailloux(this: nbCailloux() + this: value())}
    if this: op() == "-" { this: nbCailloux(this: nbCailloux() - this: value())}
    return this
    }):
    define("alumettes", |this| {
    return this: alumette()

    }):
    define("cailloux", |this| {
    return this: caillou()
    }):
    define("ajouter", |this| {
    this: op("+")
    return this
    }):
    define("enlever", |this| {
    this: op("-")
    return this
    }):
    define("une", |this| {
    this: value(1)
    return this
    }):
    define("un", |this| {
    this: value(1)
    return this
    }):
    define("deux", |this| {
    this: value(2)
    return this
    }):
    define("trois", |this| {
    this: value(3)
    return this
    }):
    define("quatre", |this| {
    this: value(4)
    return this
    })

    function combien = -> DynamicObject():
    quoi(""):
    define("de", |this| {
    return this
    }):
    define("alumettes", |this| {
    this: quoi("alumettes")
    return this
    }):
    define("cailloux", |this| {
    this: quoi("cailloux")
    return this
    }):
    define("dans", |this, boite| {
    if this: quoi(): equals("alumettes") { println(boite: nbAllumettes() + " alumettes") }
    if this: quoi(): equals("cailloux") { println(boite: nbCailloux() + " cailloux") }
    return this
    })


    function main = |args| {

    var maBoite = boite():
    ajouter(): trois(): alumettes():
    ajouter(): quatre(): cailloux():
    enlever(): une(): alumette()

    combien(): de(): cailloux(): dans(maBoite)
    combien(): de(): alumettes(): dans(maBoite)

    }
  13. k33g renamed this gist Mar 8, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  14. k33g renamed this gist Mar 8, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  15. k33g revised this gist Mar 8, 2013. 2 changed files with 7 additions and 7 deletions.
    7 changes: 7 additions & 0 deletions gistfile1.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    var maBoite = boite():
    ajouter(): trois(): alumettes():
    ajouter(): quatre(): cailloux():
    enlever(): une(): alumette()

    combien(): de(): cailloux(): dans(maBoite)
    combien(): de(): alumettes(): dans(maBoite)
    7 changes: 0 additions & 7 deletions glloq
    Original file line number Diff line number Diff line change
    @@ -1,7 +0,0 @@
    var maBoite = boite():
    ajouter(): trois(): alumettes():
    ajouter(): quatre(): cailloux():
    enlever(): une(): alumette()

    combien(): de(): cailloux(): dans(maBoite)
    combien(): de(): alumettes(): dans(maBoite)
  16. k33g created this gist Mar 8, 2013.
    7 changes: 7 additions & 0 deletions glloq
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    var maBoite = boite():
    ajouter(): trois(): alumettes():
    ajouter(): quatre(): cailloux():
    enlever(): une(): alumette()

    combien(): de(): cailloux(): dans(maBoite)
    combien(): de(): alumettes(): dans(maBoite)