Questions tagged [wren]

Wren refers to the class-based scripting language called "Wren" - https://wren.io/

4 questions
2
votes
1 answer

How do I write the equals (==) function?

class Character { construct new(name,life){ _name = name _life = life } name { _name } life { _life } } If the name and life are the same, it should return true otherwise false.
user19273273
2
votes
1 answer

How can I define a simple non-method function on wren?

The documentation of the wren scripting language http://wren.io/ explains how to define methods within a class, but I want to define a simple function and not a method. I tried this: #! /usr/bin/env wren square(n) { return n *…
0
votes
1 answer

How do I test if two lists are equal?

var a=[1,2,3] var b=[1,2,3] var c=[1,2,4] System.print(a==b) System.print(a==c) How do I check if two lists are equal? I tried the equality operator == but this doesn't work; it prints false and false
congusbongus
  • 13,359
  • 7
  • 71
  • 99
0
votes
1 answer

Wren class does not implement a field

I'm trying to learn how to use Dome and Wren. To do this I've started working on a simple Flappy Bird clone. The problem I'm having is that I get the error message Bird does not implement bird_idle It then points to line 63 in my main class which is…
OmniOwl
  • 5,477
  • 17
  • 67
  • 116