| 1 | fn main() { |
| 2 | if 1 in [1] { |
| 3 | println('yeah !') |
| 4 | } |
| 5 | if 1 !in [1] { |
| 6 | println("oh no :'(") |
| 7 | } |
| 8 | } |
| 9 | |
| 10 | fn wrapping_tests() { |
| 11 | my_arr := ['Lorem ipsum dolor sit amet, consectetur adipiscing', 'elit. Donec varius purus leo, vel maximus diam', 'finibus sed. Etiam eu urna ante. Nunc quis vehicula', 'velit. Sed at mauris et quam ornare tristique.'] |
| 12 | multi_level := [ |
| 13 | [1, 2, 3], |
| 14 | ['Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec varius purus leo, vel maximus diam', 'finibus sed. Etiam eu urna ante. Nunc quis vehicula velit. Sed at mauris et quam ornare tristique.'], |
| 15 | ] |
| 16 | } |
| 17 | |
| 18 | fn array_init_without_commas() { |
| 19 | a := [3 -4 5 -2] |
| 20 | b := [5-2,7,2*3,-4,-7*8,2*-4] |
| 21 | c := [4 6 - 7 8 3 * 4] |
| 22 | d := [&a &b &c] |
| 23 | e := u16(434) |
| 24 | f := u16(23) |
| 25 | g := u16(4324) |
| 26 | h := [e&f g g & g] |
| 27 | k := 323 |
| 28 | l := [k -k 5] |
| 29 | x := &e |
| 30 | y := &f |
| 31 | z := &g |
| 32 | q := [f *y f * g e] |
| 33 | ch := chan u16{} |
| 34 | w := [f 12 <-ch] |
| 35 | } |
| 36 | |
| 37 | struct App { |
| 38 | mut: |
| 39 | text string |
| 40 | result f64 |
| 41 | is_float bool |
| 42 | new_number bool |
| 43 | operands []f64 |
| 44 | operations []string |
| 45 | row_ops [][]string = [ |
| 46 | ['C', '%', '^', '/'], |
| 47 | ['7', '8', '9', '*'], |
| 48 | ['4', '5', '6', '-'], |
| 49 | ['1', '2', '3', '+'], |
| 50 | ['0', '.', '+/-', '='], |
| 51 | ] |
| 52 | } |
| 53 | |