Login Register


Code Golf Challenge #1 - Thue-Morse Sequence filter_list
Author
Message
RE: Code Golf Challenge #1 - Thue-Morse Sequence #11
(08-14-2015, 09:58 PM)eclipse Wrote: Fucking hell.. I didn't know golfing was a thing.

Yeah, there's a decently-large site on Stack Exchange dedicated to it. It's been running for at least 3 years.
[Image: CDUAq9d.png]

Reply

RE: Code Golf Challenge #1 - Thue-Morse Sequence #12
(08-15-2015, 02:32 PM)Shebang Wrote: Yeah, there's a decently-large site on Stack Exchange dedicated to it. It's been running for at least 3 years.

Yeah, I saw it. Without it my program would be more than 250 Bytes.

Reply

RE: Code Golf Challenge #1 - Thue-Morse Sequence #13
Sending this back up! Looking for some competition so Eclipse doesn't win too easily Tongue
[Image: CDUAq9d.png]

Reply

RE: Code Golf Challenge #1 - Thue-Morse Sequence #14
103 bytes

Written in NodeJS.

http://ideone.com/N7zDBK

Example output (the one on my computer uses argv, argv makes it just 4 bytes longer Wink ):

Code:
LVL 78 (176/3800) ~ ●●● node ~/bin2.js [ 0 ] LVL 78 (258/3800) ~ ●●● node ~/bin2.js 6 [ 0, 1, 1, 0, 1, 0 ] LVL 78 (349/3800) ~ ●●● node ~/bin2.js 20 [ 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1 ]
[Image: BXqGARG.png]

Reply

RE: Code Golf Challenge #1 - Thue-Morse Sequence #15
(08-19-2015, 01:00 PM)Stocking Wrote: 103 bytes

Written in NodeJS.

http://ideone.com/N7zDBK

Example output (the one on my computer uses argv, argv makes it just 4 bytes longer Wink ):

Code:
LVL 78 (176/3800) ~ ●●● node ~/bin2.js [ 0 ] LVL 78 (258/3800) ~ ●●● node ~/bin2.js 6 [ 0, 1, 1, 0, 1, 0 ] LVL 78 (349/3800) ~ ●●● node ~/bin2.js 20 [ 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1 ]

Use some ES6 self executing arrow functions and you could bring the byte count down.

Reply

RE: Code Golf Challenge #1 - Thue-Morse Sequence #16
(08-19-2015, 01:12 PM)Lux Wrote: Use some ES6 self executing arrow functions and you could bring the byte count down.

I can easily bring it down more than a single byte. In-fact, I can bring it down to 97. But too lazy, can't be asked to edit the code.
[Image: BXqGARG.png]

Reply

RE: Code Golf Challenge #1 - Thue-Morse Sequence #17
(08-19-2015, 01:00 PM)Stocking Wrote: 103 bytes

Written in NodeJS.

http://ideone.com/N7zDBK

Example output (the one on my computer uses argv, argv makes it just 4 bytes longer Wink ):

Code:
LVL 78 (176/3800) ~ ●●● node ~/bin2.js [ 0 ] LVL 78 (258/3800) ~ ●●● node ~/bin2.js 6 [ 0, 1, 1, 0, 1, 0 ] LVL 78 (349/3800) ~ ●●● node ~/bin2.js 20 [ 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1 ]

What is the result of n=0? It should not print out anything for this case.

EDIT: This does not function as intended for n=0 and n=1. It currently prints out n=1 for n=0, and n=2 for n=1. The rest of the test cases appear to work.
[Image: CDUAq9d.png]

Reply

RE: Code Golf Challenge #1 - Thue-Morse Sequence #18
(08-19-2015, 01:56 PM)Shebang Wrote: What is the result of n=0? It should not print out anything for this case.

Originally it would return just 0, but I fixed it (just returns an empty array).

Now it's 105 bytes. http://ideone.com/N7zDBK (same link as in the first post)
[Image: BXqGARG.png]

Reply

RE: Code Golf Challenge #1 - Thue-Morse Sequence #19
(08-19-2015, 02:05 PM)Stocking Wrote: Originally it would return just 0, but I fixed it (just returns an empty array).

Now it's 105 bytes. http://ideone.com/N7zDBK (same link as in the first post)

n=1 still prints [0,1]. It should just print [0].
[Image: CDUAq9d.png]

Reply

RE: Code Golf Challenge #1 - Thue-Morse Sequence #20
(08-19-2015, 02:21 PM)Shebang Wrote: n=1 still prints [0,1]. It should just print [0].

Yeah he just needs to set it to print the first n elements of what's returned.

Reply







Users browsing this thread: 1 Guest(s)