CMC: I have arbitrarily many socks in each of 7 colours. How many socks must I pick out in the dark for a 7 day journey in order to be sure I can wear a fresh matching pair each day?
@trichoplax assuming the socks come in pairs of the same color, then you can never be sure that you won't have only 1 pair of a certain color (because you aren't told that), and thus that any missing sock might be the only other sock of that color.
CMC: I have arbitrarily many socks in each of 7 colours. How many socks must I pick out in the dark for a 7 day journey in order to be sure I can wear a fresh matching pair each day, never wearing the same colour on 2 consecutive days?
How Many Rectangles did you Create? code-golf
Consider the points (50,60) and (200,140) as they are graphed on coordinate plane. If you were to create lines extending top to bottom and left to right about those points, you would get this result:
Now, how many rectangles are here? Well, counti...
@MᴀʀsUʟᴛᴏʀ Exactly. I actually mistakenly thought this was the answer to my first version, and then realised I'd forgotten to specify no consecutive days...
I'm new to code-golf and I'm curious about the obscure languages these challeges are answered in. The symbols and unicode characters, how do you memorize/use the languages? How do you write the code and how does the interpreter/compiler know what to do with the characters?
I'm sure many of you want to attract golfers to compete in your favorite language. Given that it takes time to learn a language for golfing, why choose it over others? What aspects of the language make it fun to golf? What skills or mindset do you gain? Please be specific and concrete.
Any lang...
you know, if we were to rank languages by the amount of bashing/praise it got in this chat room, one would think that Jelly was the world's greatest language
How Many Rectangles did you Create? code-golf
Consider the points (50,60) and (200,140) as they are graphed on coordinate plane. If you were to create lines extending top to bottom and left to right about those points, you would get this result:
Now, how many unique rectangles are here? Well,...
If we label them A through I, then I counted A, B, C, D, E, F, G, H, I, AB, BC, ABC, DE, EF, DEF, GH, HI, GHI, AD, DG, ADG, BE, EH, BEH, CF, FI, CFI, ABDE, BCEF, ABCDEF, DEGH, EFHI, DEFGHI, ABDEGH, BCEFHI, ABCDEFGHI. Which is 36.
@HelkaHomba How about, instead of a M x N input, the input is an integer representing a number of points on the coordinate plane? It adds more of a challenge, and it stays somewhat similar to my original idea.