diff options
Diffstat (limited to 'src/coffee.lox')
-rw-r--r-- | src/coffee.lox | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/coffee.lox b/src/coffee.lox new file mode 100644 index 0000000..d83e528 --- /dev/null +++ b/src/coffee.lox @@ -0,0 +1,15 @@ +class CoffeeMaker { + init(coffee) { + this.coffee = coffee; + } + + brew() { + print "Enjoy your cup of " + this.coffee; + + // No reusing the grounds! + this.coffee = nil; + } +} + +var maker = CoffeeMaker("coffee and chicory"); +maker.brew(); |