« first day (405 days earlier)      last day (873 days later) » 

15:19
Scala CMC: Implement zipWith (Scastie with the signature to start out with)
(ignore the error, hit "Clear messages" to git rid of it. Use Ctrl+S or the Run button to save and run)
Actually, that's not a very good challenge to start with
Slightly better starting CMC: Write a safe head function that gives the first element of a list wrapped in a Some if it's nonempty and a None if it's empty
 
2 hours later…
17:57
Nope, that's the bugged version. One moment...
@user 65 bytes (naïve version)
 
1 hour later…
The second one is quite smart!
Scala 3 also has polymorphic function literals, although that requires modifying the use site a bit :(
CMC: Cartesian product of two lists (or sets, whatever you like best)
19:47
That's because of 0 to list1.length. to makes an inclusive range, so it tries to access the element at index 3, which doesn't exist because there's only 3 elements in the list. You could try either 0 to list1.length - 1 or 0 until list1.length instead
You don't need semicolons, and list3 doesn't have to be a var
This is a slightly cleaned-up version
But you can use a for comprehension instead. Also, Arrays are mutable and hard to print, so let's avoid those
Here's a horribly inefficient but fun version using pattern matching that also works with lists of different sizes (it trims to the size of the shorter list)
6 messages moved from Vyxal
Oh, and if you're lazy, you can do this using lazyZip from the standard library
@emanresuA The message-moving made this a bit messy, but all the moved messages were replies to you, as well as the message right above this one

« first day (405 days earlier)      last day (873 days later) »