This channel is intended for people just starting with the Raku Programming Language (raku.org). Logs are available at irclogs.raku.org/raku-beginner/live.html Set by lizmat on 8 June 2022. |
|||
00:04
MasterDuke joined
00:55
MasterDuke left
01:14
Manifest0 left
01:23
hythm joined
01:29
hythm left
02:27
ToddAndMargo joined
|
|||
ToddAndMargo | Is there a way to ask .contains if there is any instance of swept letters. I am wanting to know if ANY of the following are found "a..z". So if "c" is in the string, .contains says true | 02:30 | |
Dr.Doom | {.sort,{sort .[0],[R-] $_ } ... *.cache.grep({[eq] $_})} | 03:08 | |
i want to genrate this sequence untill the elements as all the same same elements | 03:09 | ||
03:31
camelia left
|
|||
ToddAndMargo | Is there a way to do it with .contains? | 03:32 | |
03:36
camelia joined
|
|||
Dr.Doom | don't no just picked up the language few days ago | 03:40 | |
(3 7) (3 4) (1 3) (1 2) (1 1) (0 1) | 03:41 | ||
for example it must stop at (1,1) | |||
ToddAndMargo | I think the best way is going to be with regex. I copied my exampled to vpaste: vpaste.net/ebRuT | 03:43 | |
Dr Doom, you a human or a robot responder? | 03:53 | ||
Dr.Doom | sub f($a,$b){ gather{ unless $a eq $b{ take ($a,$b); ($a,$b) = ($b,$a - $b); } } } | 03:55 | |
this is what I want to achive | |||
human, what kind of question was that? | |||
ToddAndMargo | I have had to suffer with so many (annoying) AI robot responder today, that I really really curious (discord bot shounds like an AI) | 03:57 | |
05:14
ToddAndMargo left
05:37
chi joined,
chi left
07:29
beginner_toad joined
07:34
andinus left,
andinus joined
07:35
andinus left
07:36
andinus joined,
andinus left
07:37
andinus joined
07:40
Manifest0 joined
|
|||
Dr.Doom | (39 => True 38 => True 6 => True 26 => True 10 => True 33 => True 21 => True 46 => True 4 => True 49 => True 25 => True 9 => True 14 => True 15 => True 35 => True 22 => True 34 => True) why does converting a set to list results in this | 08:57 | |
say ((1..100).grep(*.is-prime) ==> {$_.grep(* + 2 ⊆ $_)}()) | 09:45 | ||
how to get this to work | |||
m: ((1..100).grep(.is-prime) ==> {$_.grep( + 2 ⊆ $_)}()).say | |||
Raku eval | Exit code: 1 The iterator of this Seq is already in use/consumed by another Seq (you might solve this by adding .cache on usages of the Seq, or by assigning the Seq into an array) in block <unit> at main.raku line 1 | ||
nemokosch | What will it do when "working"? Just to be on the same page | 09:46 | |
Dr.Doom | need to get all the twin primes between 1..100 | ||
nemokosch | Something with twin primes | ||
Okay | |||
Dr.Doom | m: my @a = Array(1..100); say (@a.grep(.is-prime) ==> {$_.grep( + 2 ⊆ $_)}()).say | 09:49 | |
Raku eval | Exit code: 1 The iterator of this Seq is already in use/consumed by another Seq (you might solve this by adding .cache on usages of the Seq, or by assigning the Seq into an array) in block <unit> at main.raku line 1 | ||
nemokosch | The Seq comes from grep | 09:50 | |
So the immediate fix would be to chain .cache on the prime sequence | 09:51 | ||
Dr.Doom | thanks | 09:52 | |
nemokosch | Do you know rotor, by the way? | ||
m: (1..100).grep(*.is-prime).rotor(2 => -1).say | 09:53 | ||
Raku eval | ((2 3) (3 5) (5 7) (7 11) (11 13) (13 17) (17 19) (19 23) (23 29) (29 31) (31 37) (37 41) (41 43) (43 47) (47 53) (53 59) (59 61) (61 67) (67 71) (71 73) (73 79) (79 83) (83 89) (89 97)) | ||
nemokosch | Take two values, then skip over -1 ie roll back 1 | 09:54 | |
10:03
beginner_toad left
|
|||
Dr.Doom | wow | 11:22 | |
that's awesome | 11:23 | ||
nemokosch | and then you could do stuff lik | 11:32 | |
11:42
teatwo joined
11:45
tea3po left
|
|||
casually leaving it open for an hour | 12:17 | ||
concentration issues be like... anyway | |||
m: (1..100).grep(*.is-prime).rotor(2 => -1).grep({ [-] $_ == 2}).say | |||
Raku eval | ((2 3) (3 5) (5 7) (7 11) (11 13) (13 17) (17 19) (19 23) (23 29) (29 31) (31 37) (37 41) (41 43) (43 47) (47 53) (53 59) (59 61) (61 67) (67 71) (71 73) (73 79) (79 83) (83 89) (89 97)) | ||
nemokosch | not quite | ||
the betrayal | 12:18 | ||
I will probably type it out, the precedence is funny | 12:19 | ||
m: (1..100).grep(*.is-prime).rotor(2 => -1).grep({ .[1] - .[0] == 2 }).say | |||
Raku eval | ((3 5) (5 7) (11 13) (17 19) (29 31) (41 43) (59 61) (71 73)) | ||
nemokosch | dang | ||
15:34
jgaz left
15:36
jgaz joined
15:41
jgaz left
|
|||
librasteve | crag-of-the-week (using raku App::Crag) | 16:32 | |
crag 'say (0rXXIII + 0rMM).&to-roman' # MMXXIII | 16:34 | ||
16:34
swaggboi left
|
|||
^^ Slang::Roman is now included | 16:34 | ||
16:36
swaggboi joined
17:41
jgaz joined
20:49
discord-raku-bot left
21:20
discord-raku-bot joined
22:04
discord-raku-bot left
22:11
discord-raku-bot joined
22:25
teatwo left
22:36
teatime joined
23:41
teatime left
23:42
teatime joined
23:43
Manifest0 left
|