#Deck of cards First we pick a random card, then in the second line we shuffle the whole deck of cards, including the one chosen
((1,2,3,4,5,6,7,8,9,10,'j','q','k') X~ <♥,♦,♣,♠>).roll
((1,2,3,4,5,6,7,8,9,10,'j','q','k') X~ <♥,♦,♣,♠>).pick(52)
| $ perl6 -MBioInfo | |
| To exit type 'exit' or '^D' | |
| > my @dna = ` | |
| * >id comment | |
| * CCCGAACGGCTT | |
| * `; | |
| [>id comment | |
| CCCGAACGGCTT | |
| ] | |
| > @dna[0].translate |
| use v6; | |
| # Hex => Dec | |
| :16("ff").base(10); # 255 | |
| # Dec => Bin | |
| :10("10").base(2); # 1010 | |
| # Bin => Hex | |
| :2("1111").base(16); # F |
| # Add this snippet to the top of your playbook. | |
| # It will install python2 if missing (but checks first so no expensive repeated apt updates) | |
| # [email protected] | |
| - hosts: all | |
| gather_facts: False | |
| tasks: | |
| - name: install python 2 | |
| raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal) |
| #!/usr/bin/env perl6 | |
| my Int $len = 16; | |
| my $maxlen = 32768; | |
| my $how-many =100000; | |
| while $len < $maxlen { | |
| my $start = now; | |
| my int @ones[$len]; | |
| for 1..$how-many { | |
| loop (my int $i = 0; $i < $len; $i++) { |
#Deck of cards First we pick a random card, then in the second line we shuffle the whole deck of cards, including the one chosen
((1,2,3,4,5,6,7,8,9,10,'j','q','k') X~ <♥,♦,♣,♠>).roll
((1,2,3,4,5,6,7,8,9,10,'j','q','k') X~ <♥,♦,♣,♠>).pick(52)
| TLDR: | |
| https://github.com/skids/rakudo/tree/rolevolution3 | |
| ... is a spectest-passing branch of rakudo with: | |
| A) Working diamond role composition | |
| B) A solution to Ovid's complaint about role method overrides | |
| ...but the code needs a bit of work. |
| console.log(1); | |
| (_ => console.log(2))(); | |
| eval('console.log(3);'); | |
| console.log.call(null, 4); | |
| console.log.apply(null, [5]); | |
| new Function('console.log(6)')(); | |
| Reflect.apply(console.log, null, [7]) | |
| Reflect.construct(function(){console.log(8)}, []); | |
| Function.prototype.apply.call(console.log, null, [9]); | |
| Function.prototype.call.call(console.log, null, 10); |
| """ | |
| Lee tres números, dos son los extremos de un intervalo y el tercero es el número que hay que comprobar si se encuentra en el intervalo. | |
| """ | |
| minimo = int(input()) | |
| maximo = int(input()) | |
| numero = int(input()) | |
| print(minimo <= numero <= maximo) |
| """ | |
| Listar todos los números que sean potencia de dos entre los 1000 primeros números. | |
| """ | |
| from math import log2 | |
| list(filter(lambda x: log2(x) == int(log2(x)), range(1, 1000))) |