Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: fb11f13cda
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 31 lines (23 sloc) 0.548 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
#!./parrot perl6.pbc

# check logical ops

use v6;

say '1..16';

1 and say 'ok 1';
0 or say 'ok 2';
1 && say 'ok 3';
0 || say 'ok 4';
0 xor say 'ok 5';
0 ^^ say 'ok 6';

## chaining logical ops
(1 and 2) and say 'ok 7';
(2 && 4) and say 'ok 8';
(0 or 2) and say 'ok 9';
(2 || 0) and say 'ok 10';
(1 xor 0) and say 'ok 11';
(1 ^^ 1) or say 'ok 12';

## interesting
(1 and 0 xor 1 or 0) and say 'ok 13';
(1 and 0 xor 0 || 1) and say 'ok 14';

## more interesting
(5 and 0 xor 0 || 3) == 3 and say 'ok 15';
(0 xor 0 ^^ 42 or 1) == 1 or say 'ok 16';
Something went wrong with that request. Please try again.