9/11/2023 0 Comments Party parrot slack![]() ![]() The extension Collection where SubSequence: RangeReplaceableCollection constraint is worth pausing on. The second error points to the RangeReplaceableCollection overload of +(_:_:) being selected, which means we can quickly resolve the compilation error by following its guidance and returning a Subsequence out (since concatenating two Subsequences yields a Subsequence). for the return type, which we’ll address next). ( …now’s your chance to draft an approach before the spoiler below.) That is, write a script with the following output: It’s a fun problem to think on: given some set of (successively delayed) party parrot emojis - say :wave1parrot:, :wave2parrot:, …, :wave8parrot: -, write a snippet to generate an 8×8 square of them doing the wave. Joe Spadafora sent an emoji masterpiece in our team’s Slack the other day that doubled as a code golf. I’ve added a footnote 1 with his workaround that coincidentally uses John’s hint at the end about leaning on the square’s symmetry across the diagonal. Soroush messaged that using RangeReplaceableCollection’s + overload unfortunately incurs a copy. There will likely be typos, mistakes, or wider logical leaps - the intent here is to “ let others look over my shoulder while I figure things out.”) (This is an entry in my technical notebook. Party Parrot waves and Collection rotations ⇐ Notes archive ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |