« first day    last day (149 days later) » 

9:10 AM
Suggestion #15: Counter.
[1, 1, 2, 1, 3, 4, 1, 2, 8] -> [[1, 4], [2, 2], [3, 1], [4, 1], [8, 1]]
Suggestion #16: Group the indices depending on the elements of an array
[1, 5, 1, 1, 1, 1, 5, 1, 5, 4, 4, 4] -> [[0, 2, 3, 4, 5, 7], [9, 10, 11], [1, 6, 8]]
Suggestion #17: Cyclically Rotate list Y by X places (both left and right).
[1,2,3,4,5], 2 -> [4, 5, 1, 2, 3] (right), [3, 4, 5], 1 -> [4, 5, 3] (left)
Alternatively, instead of having both left and right, we could just have right and for left we would use negative integers.
Suggestion #18: Cyclic successor of X in Y.
"abc", "omnabcde" -> "bcd"
"cde", "omnabcde" -> "deo"
@cairdcoinheringaahing I have added 4 new suggestions. When you are online, please share your thoughts on about them. Cthulhu will have all of them (maybe except for group indices)
 
 
1 hour later…
10:40 AM
@Mr.Xcoder I'm not going to include cyclic successor or group the indicies, but I'll add #15 and #17
 
 
1 hour later…
11:42 AM
How about this: A "quick" so to say that takes the next 2 commands, then pushes a list of the results? e.g. [1, 2, 3, 4] and the min and max commands => [1, 4]`.
 
@cairdcoinheringaahing Some kind of "Bifurcate", yeah, good idea
Also, there's this... I you have a function and a variable, it would be nice to have a built-in that turns them into [variable, function(variable)].
For example, if R is the function for Reverse, [1, 2, 3] is the variable and the built-in is B, by doing RB[1,2,3] you obtain [[1,2,3], [3,2,1]]
 
@Mr.Xcoder Yeah, that could be very helpful
 
I have used this a lot in Pyth especially, and (at least for prefix notation) it is indeed helpful
I have yet another idea
Say you have a function that takes two values (dyad) and want to map it over a list. Let's say the list is [[1,2,3],[1,2,3],[3,4,5],[1,2,4]] and you want to get the second element of each. Instead of map-index_built_in-variable_of_map-1-list you could do index_built_in-"right-map"-1-list
like, instead of m@d1L you could do @R1L. Mapping with a dyad, to be more specific
Ping me if you say anything, I won't be in the room
 
12:00 PM
@Mr.Xcoder Ok, yeah I understand it. I might add that to Deorst, not sure though
 
 
5 hours later…
4:42 PM
@Mr.Xcoder how about is mersenne, and is germain?
 
@cairdcoinheringaahing Cthulhu won't have either of them
 
@Mr.Xcoder I might add them to Deorst, just for lolz
 
Mersenne is quite trivial, bitwise or with input and input + 1.
Germain is also quite trivial, increment the double, check if prime
SO 3 bytes each or so
@cairdcoinheringaahing Now, I want to have a little series of CMCs and how they should look in Cthulhu and Deorst
Are you free rn?
 
@Mr.Xcoder sure. How about the simple challenges from JHT?
 
@cairdcoinheringaahing Ok, some of them. First off, let's list the 10 basic ones.
 
4:53 PM
 1) +
2) –
3) ×
4) ÷
5) :
6) %
7) _
8) À
9) Ñ
10) Ń
ಠ_ಠ I hate markdown
 
Addition +E, Subtraction -IE, Multiplication *E, Divide /QE, Integer Divide ÷QE, Mod %QE, Negate Ɲ, absolute value ä
NOTE
 
@Mr.Xcoder I'm guessing E is output?
 
If I make Cthulhu take the input from CLA, All the QE will be replaced by the empty string.
@cairdcoinheringaahing No. E is evaluated input (i.e Second input in this case).
I decided. Cthulhu will take input from CLA.
 
So what are I and Q?
 
Cthulhu with CLA: Addition +, Subtraction -, Multiplication *, Divide /, Integer Divide ÷, Mod %, Negate Ɲ, absolute value ä .
@cairdcoinheringaahing Q should be I everywhere, sorry. I means input (first input in this case). But I changed my mind though ^
 
4:58 PM
Next challenge?
> Create an N×M 2D array (list of lists) of anything. Even inconsistent values are allowed.
 
Wait
I have to plug in the charger, brb
@cairdcoinheringaahing I'm back... Um, Cthulhu is kinda lengthy here
 
@Mr.Xcoder I'm trying to find my Jelly answer and copy that :p But I'll have a got at a genuine Deorst one
 
@cairdcoinheringaahing I think it should be *E*W (4 bytes)
Disclaimer: Things will probably change a lot.
@cairdcoinheringaahing For when you are done with the current CMC, compute 1/N.
 
› - Repeat n times; [4, 5] => [[1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5]]
F - Flatten; [1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5]
çà - Chunks of arg 1 (4) => [[1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,5]]
4 bytes
@Mr.Xcoder More or less the same with Deorst
@Mr.Xcoder Ř - Reciprocal
 
To my CMC, the solution is
 
5:08 PM
@Mr.Xcoder Makes sense :p
 
@cairdcoinheringaahing Next CMC: Given an integer, find the next prime. If the integer is prime, then the prime after it.
Cthulhu, 1 byte:
 
@Mr.Xcoder ĎPΨ)Ñ
 
Interesting.
BRB writing a version without the built-in
 
@Mr.Xcoder Its the "If the integer is prime, then the prime after it." (May change)
 
Without built-in: ƑƤ
first prime in [input+1, input+2, ...]
 
5:13 PM
Ď      - Duplicate; [4, 4]
 P     - Is prime?; [4, 0]
  Ψ    - If ToS (pops)...
    )  -  increment
     Ñ - Next prime
 
Reasonable
@cairdcoinheringaahing Now you choose a CMC
And BTW, built-in suggestion #19: Are all the elements in a list consecutive?
 
@Mr.Xcoder From now on, should we just pin suggestions we like?
 
That can be deltas, decrement, negate each, any, but should save 3 bytes
@cairdcoinheringaahing Yes
 
@Mr.Xcoder This should be fun. Draw a diagonal line from top-left to bottom-right, using space as padding and a consistent non-whitespace char as the line
 
Oh... Cthulhu won't like it :)
 
5:19 PM
¢¡Ŕ\…
 
Cthulhu, 8 bytes: Ɱ+*sı’\¨
 
5 bytes.
¢     - Open canvas mode
 ¡  … - For as many times...
  Ŕ\  - Draw \ going down and to the right
 
Ɱ          - Map with a variable ı
 +         - Concatenate
  *sı      - A space repeated ı times
     ’\    - The one-character String "\"
        ¨  - Unary range to the input
@cairdcoinheringaahing o_O Canvas Mode
 
> ζ - Toggle Internet query mode
^ Even better :D
 
I choose the next CMC
 
5:22 PM
@Mr.Xcoder Also, Deorst must win everything, even against Charcoal :p
 
@cairdcoinheringaahing CMC: Given a contiguous substring of the alphabet (choose either lowercase or uppercase), whose length is lower than 26, return the substring of the same length following it.
abc -> bcd
yz -> za
 
@Mr.Xcoder Oooh, nice.
 
abcdefghijklmnopqrstuvwxy -> bcdefghijklmnopqrstuvwxyz
 
Cyclic successor ಠ_ಠ
 
You can do it without that in a very simple manner anyway
Cthulhu, »Qå
@cairdcoinheringaahing Do you want me to tell you a golfy algorithm?
 
5:27 PM
@Mr.Xcoder Hold on, I'm writing it
 
@cairdcoinheringaahing And then solve it in Python too, please
 
ªAĎ€î€)26€%€ï
Way too long.
@Mr.Xcoder what's your algorithm?
 
Yeah, you probably do not know the golfy algorithm I was talking about
 
@Mr.Xcoder Why not?
 
@cairdcoinheringaahing 1. Generate the alphabet. 2. Get the index of the substring. 3. Double the alphabet. 4. Get double_alphabet[alphabet.index(substring)+1:][:len(substring)]
I think it might be shorter this way
@cairdcoinheringaahing what do you think?
 
5:32 PM
@Mr.Xcoder In that case, ªAî)ªAÈïàLH
Saves 2 bytes
 
Still saves
Yeah
 
Note to self: add implicit argument type swapping: If a function takes string, int and gets int, string, swap them.
 
@Mr.Xcoder Would import string;string.ascii_upper help?
 
@cairdcoinheringaahing I think that's much longer than 30 bytes
@cairdcoinheringaahing that's 73 bytes
 
5:37 PM
@Mr.Xcoder Yeah, the full version in 76 bytes (string.ascii_uppercase)
CMC: Draw a square with side length N
 
Again, Deorst will win
 
@Mr.Xcoder Cthulhu won the last one
Plus, code golf is about the shortest code in each language :p
 
@cairdcoinheringaahing I know. The distribution is completely fair. I was talking about String challenges in general
@cairdcoinheringaahing Cthulhu, 7 bytes: *+*’#In
 
@Mr.Xcoder 6 bytes: ¢ĎŘÛŁΞ
 
@cairdcoinheringaahing I count 6 bytes
 
5:41 PM
ಠ_ಠ I can't count
 
Quite ok, given that Cthulhu sucks at strings
 
@Mr.Xcoder I need to go for now, I'll be back in 10-20 minutes
 
@cairdcoinheringaahing I think I'll stay around. Ping when you get back
For reference this is the solution in Pyth: *+*\#Qb (7 bytes too)
 
5:54 PM
Very good break to extend my explanation
 
6:11 PM
@Mr.Xcoder Ok, I'm back (for a bit)
 
I am here too
Your challenge has been closed :'-(
 
@Mr.Xcoder That is the only challenge to be closed as a dupe of 5 challenges. I'm fine with it
 
I am not... That way my answer won't receive any more attention, and I just improved its explanation dramatically
 
CMC: Given an array of numbers, return an array of [mode, mean, median]. Order of the output doesn't matter
 
Oh, that should be pretty trivial
 
6:15 PM
@cairdcoinheringaahing 4 bytes: ‚ÅĀĄ. Outputs [mode, mean, median]
Damn, I've got to go now and eat. Ping me with your response (and a new CMC?)
 
Let me see what characters I shall pick
@cairdcoinheringaahing Ok
@cairdcoinheringaahing Cthulhu, 4 bytes: ð·•⍊
@cairdcoinheringaahing For when you get back, CMC: Output the prime (absolute) deltas of a list
[1,4,2,8,9,2] -> [3, 2, 7]
Cthulhu, 3 bytes: ƤƑ⟝ (Ƒ means first when given an integer, Ƒ means filter when given a list)
Unfortunately, I must go now. Bye!
 
6:47 PM
Bye!
@Mr.Xcoder 4 bytes: Đ¥PÀ
 
7:02 PM
ð  - Absolute deltas; [[3, 2, 6, 1, 7]]
¥P - Filter keep primes; [[3, 2, 7]]
 
@cairdcoinheringaahing U here?
 
@Mr.Xcoder Yep
 
It turns out I can stay
 
@Mr.Xcoder should I think of a CMC?
 
yes
 
7:06 PM
How about Find the largest list of consecutive positive integers that sum to N?
 
@cairdcoinheringaahing easy
@cairdcoinheringaahing Cthulhu, 4 bytes: ⟞ˇƑþ
 
@Mr.Xcoder ಠ_ಠ 8 bytes: Ś¥[S=]ΞL
 
    þ     - Integer partitions
   Ƒ      - Filter
  ˇ       - All are consecutive
 ⟞       - Last element.
@cairdcoinheringaahing Algorithm?
 
Ś     - Sublists
¥[  ] - Filter keep...
  S=  - Sum == input
Ξ     - Maximum by...
 L    - Length
Hey, I got the markdown right first time!
 
thinks a new challenge is posted - It's an off-topic programming question fail :-(
 
7:13 PM
@Mr.Xcoder I think there are more of those kind of questions than normal questions with votes > 100 ಠ_ಠ
 
Now to VTD it
@cairdcoinheringaahing I feel very well that I have consecutive? - Pyth is 15 bytes: tolNf!.EtM.+T./
Now you should feel good too
 
@Mr.Xcoder I'm just glad I tie Jelly
 
7:59 PM
@cairdcoinheringaahing False. Sum is Σ
 

« first day    last day (149 days later) »