Skip to main content

Timeline for Is it an Element?

Current License: CC BY-SA 4.0

9 events
when toggle format what by license comment
Aug 29, 2023 at 21:35 history edited Level River St CC BY-SA 4.0
deleted 1134 characters in body
Aug 29, 2023 at 21:05 comment added Level River St @ValueInk Be was missing from the original question and has been edited in later. Not sure why I missed S, it's missing from the source code I used to make the magic string. I will fix it ASAP - it will add 2 bytes.
Aug 29, 2023 at 20:40 comment added Value Ink Running your code against dingledooper's test battery on their answer shows an incorrect answer for Beryllium Be, and modifying it to check single-letter elements also shows an incorrect answer for Sulfur S. (The TIO/ATO link demonstrating this is too long for this comment.)
Aug 29, 2023 at 19:29 comment added Level River St @ValueInk thanks for the tips. It was shorter in the end to get rid of the array and just test each value as it is produced. Harder to test the code that way, though.
Aug 29, 2023 at 19:08 history edited Level River St CC BY-SA 4.0
added 1030 characters in body
Aug 29, 2023 at 5:37 comment added Value Ink Actually, you can initialize it as a hash with ->n,**a, populate with a[(j+=j==34?338:i-34).to_s(36).capitalize]=1, and return a[n] to save 1 more. It won't be literal true/false, but it's truthy/falsy.
Aug 29, 2023 at 5:17 comment added Value Ink Initialize your array with ->n,*a{ for -2.
Aug 29, 2023 at 3:35 history edited Level River St CC BY-SA 4.0
deleted 16 characters in body
Aug 29, 2023 at 1:22 history answered Level River St CC BY-SA 4.0