27
\$\begingroup\$

As of 27/12/20, the challenge is over as no new answers were posted on the 26th. With an astounding 55 points (and 21 answers), the winner is pppery!

A quick shout out to the top 5 scorers as well:

  • 1st. pppery with 55 points across 21 answers
  • 2nd. tsh with 50 points across 21 answers
  • 3rd. SunnyMoon with 21 points across 6 answers
  • 4th. NieDzejkob with 17 points across 4 answers
  • 5th. pxeger with 16 points across 7 answers

A full table of everyone's daily scores can be found below. Empty cells indicate no answer


This challenge will function somewhat like an question, in that new answers will (somewhat) depend on old answers. However, this is (as far as I can tell) a unique form of , so be sure to read the entire challenge if you'd like to take part.

Normally, challenges work in increments of answers. Each new answer is related to the previous answer, and so on. However, in this challenge, we will change the increments from single answers to single days.

Here's a step-by-step breakdown of how the challenge will work:

  • The challenge will be posted at exactly 00:00UTC
  • From then until 23:59UTC, users may post answers that complete the task (specified below) while also following some of the restrictions (also specified below). Each answer will include:
    • A language available to be used
    • A program in that language which completes the task
    • A single restriction on the source code of new answers
  • At 00:00UTC, the restrictions will update from those listed in the body of the challenge, to those listed by answers posted the previous day.
  • Repeat the previous 2 steps until the challenge ends.

Task

All answers, regardless of when they were posted, must output the number of days the challenge has been going at the time of posting. So the first set of answers will output 1, those posted on the second day 2, third day 3 etc.

Restrictions

For the answers posted on the first day, the first set of restrictions are:

  • You must include the 0x10 byte in your source code
  • You must have an even number of bytes in your source code
  • You must only use even bytes in your source code

When you choose your restriction, you may only impose a restriction on the source code. This can be as weird as you like (e.g. it must be shaped like unfolded Hexagony code), or a basic as "cannot use this byte", but you may only restrict the source code, rather than e.g. language used. As a general rule, if a challenge including this restriction would be tagged or , it's good to go.

Scoring

New answers do not have to follow all of the restrictions. Instead, they must choose between 1 and all the restrictions to follow. Each answer is worth a number of points equal to the number of restrictions it follows. Your score is the total for all of your answers. Highest score at the end of the challenge wins.

Ending criteria

The challenge ends when an entire day passes with no new answers, as the restrictions will be updated to nothing.

Formatting

Please format your answer in the following way:

# Day <N>. <Language>, score <X>

    <code>

This follows the restriction(s):

- <restriction 1>
etc.
- <restriction X>

Answers posted tomorrow may use the restriction that <restriction>

---

<Anything else you want to include>

Rules

  • You may only post 1 answer per day
  • You may only specify 1 restriction in your answer. This restriction may be impossible (as people do not have to use it), and may be the same as another answer posted that day. It may also be the same as a restriction from a previous day, but I encourage you to choose more original restrictions over reusing ones.
  • Your score only counts unique restrictions used. If the same restriction is specified by 3 previous day answers, you may only count it as 1.
  • You may use any language that hasn't been used on a previous day. You may use a language that has already been used this day, so multiple answers on a specific day can use the same language.
  • Byte count has no bearing here, so you are under no obligation to golf your code.
  • If restrictions involve specific bytes to be avoided, included etc., you may use any pre-existing code page of your choice, so long as it is supported by your language
  • You may submit either a full program or a function, so long as it operates under our standard output formats
  • Be sure to pay attention to when you are posting your answer. If it is posted at 00:00UTC, it is the first answer for the next day, not the last answer for the previous day.
  • Times will be measured using SE's time and dating for posts, which can be seen by hovering your mouse over posts which still have "posted X hours ago" or "posted yesterday"
  • Different versions of languages, e.g. Python 2 and Python 3 are different languages. As a general rule, if the different versions are both available on Try It Online, they are different languages, but keep in mind that this is a general rule and not a rigid answer.
    • Regardless of whether they're both on TIO, minor versions of a language (e.g. Python 3.4 and Python 3.8) are not different languages.

Good luck!


Daily scores

Day Redwolf Programs Lyxal Bubbler Jonathan Allan Razetime tsh NieDzejkob Noodle9 SunnyMoon pppery user PkmnQ Ramillies pxeger
Points 9 3 3 3 3 50 17 2 21 55 6 11 6 16
Answers 2 1 1 1 1 21 4 1 6 21 1 2 1 7
1 3 3 3 3 3 3 3 2 3 3
2 6 6 5 7 7 6 5 6
3 5 6 6 6
4 2 4 2 4
5 1 2
6 2
7 1 1
8 2 2
9 2 2
10 2 1
11 2 2
12 2 2 2
13 3 3
14 1 1 1
15 3 3 3
16 3 2 3
17 3 3 3
18 2 2
19 2 2
20 2 2
21 2 2 2
22 3 3
23 2 2
24 2
\$\endgroup\$
15
  • \$\begingroup\$ Sandbox \$\endgroup\$ Dec 2 '20 at 0:01
  • 3
    \$\begingroup\$ @roblogic Within a few days the post with say “Asked on Dec 2 '20 at 00:00” but until then, this comment should suffice \$\endgroup\$ Dec 2 '20 at 1:30
  • 3
    \$\begingroup\$ For the formatting, I think the "tomorrow's restriction" part should go after the "this solution follows these restrictions" part. \$\endgroup\$
    – Bubbler
    Dec 2 '20 at 2:36
  • 9
    \$\begingroup\$ Just a reminder for all: my timezone is the same as UTC, so I may potentially be asleep at 00:00 UTC. If the list of restrictions has not been updated by 2:00 UTC, I'm likely asleep, so I'd appreciate anyone being willing to update it in such a case. \$\endgroup\$ Dec 4 '20 at 1:01
  • 1
    \$\begingroup\$ @SunnyMoon all previous days, otherwise the challenge never ends \$\endgroup\$ Dec 4 '20 at 16:15

70 Answers 70

2
\$\begingroup\$

Day 8, str, score 2

7ne:8o;o_8

Try it online!

Satisfies both restrictions:

Answers tommorrow may use the restriction that they include no characters that are used in this answer or other day 8 answers.

\$\endgroup\$
2
  • \$\begingroup\$ Do you mean characters? So... Maybe I should find out another "日本語プログラミング言語" (Japanese programming language) tomorrow... // But maybe I should find some language for today first... \$\endgroup\$
    – tsh
    Dec 9 '20 at 1:57
  • \$\begingroup\$ Yes, I said "characters". (And your day 7 japanese answer is irrelevant, because my restriction cares about day 8 answers) \$\endgroup\$ Dec 9 '20 at 2:01
2
\$\begingroup\$

Day 12, Yabasic, score 2

print--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------6+6

Try it online!

  • may still work by deleting exactly 2 nonconsecutive bytes
    • delete any two - works
  • exactly 1024 bytes long and break if any single byte is removed
    • Remove any character in print doesn't yield output
    • Remove any -, +, or 6 yield wrong output

Tomorrow: Your program should contain at least 2 more ) than (, 4 more ] than [, 8 more } than {. When any number of character ), ], } removed, your program doesn't work.

\$\endgroup\$
2
\$\begingroup\$

Day 13, C# (.NET Core), score 3

using System;class P{static void Main(){var A="))]]]]}}}}}}}}0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";if(A.Length==117)Console.Write(A.Length/9);}}

Try it online!

There isn't a C# answer yet...

  • contain no ASCII spaces or line feeds. (All spaces are full-width ones  )
  • more even bytes than odd bytes and breaks if any number of even bytes are deleted
  • contain at least 2 more ) than (, 4 more ] than [, 8 more } than {. When any number of character ), ], } removed, your program doesn't work.

Tomorrow: The sum of each bytes of your source code is a non-zero value which equals to the product of each bytes.

Let's say your source code contains \$n\$ bytes (\$n\neq0\$), whose byte value is \$b_0,b_1,\dots,b_{n-1}\$:

$$\sum_{i=0}^{n-1}b_i=\prod_{i=0}^{n-1}b_i\neq0$$

\$\endgroup\$
1
  • \$\begingroup\$ I didn't considered the requirement may be archive easily... Maybe impossible when other restriction posted later today. Maybe require \$\frac{\prod_{i=0}^{n-1}b_i}{\sum_{i=0}^{n-1}b_i}\$ to be a prime could be easier. But I'm not going to change it now... \$\endgroup\$
    – tsh
    Dec 14 '20 at 3:42
2
\$\begingroup\$

Day 14, Wikitext, score 1

{{echo|14}}

Byte average is \$103 \frac{2}{9}\$

Answers tomorrow may use the restriction that they do not contain any characters used in Day 14 answers.

\$\endgroup\$
2
2
\$\begingroup\$

Day 19, calc (TTK), score 2

023 #Tip

Try it online!

  • at least 8 char long, Both upper, lower, number and other chars TIO
  • each byte has its position as factor TIO

Many languages use a single # as start of line-wise comment. And a # has ASCII value 35. So all you need is to find some expression works in 4 or 6 bytes.

So following JavaScript code suggest 023 or 023 -0 would work:

charset = '+-*/0123456789 '

function search(l = 0, prefix='') {
  if (prefix.length === l) {
    try {
      const r = eval(prefix);
      if (r === 19) {
        print(prefix);
      }
    } catch (e) {}
  } else {
    const pos = prefix.length + 1;
    [...charset].forEach(ch => {
      if (ch.charCodeAt() % pos !== 0) return;
      search(l, prefix + ch);
    });
  }
}

search(4)
search(6)

Try it online!

So maybe any language that:

  • Support 0 start number as octal
  • Support # as comment
  • Print the value by default, or maybe by symbols like @

should work.


Tomorrow: A space has code point U+0020. So, next day... Your source code, when decode as extended ASCII, should contain at least one whitespace character. When any whitespace character is removed or replaced by any other non-whitespace character, your program should fail to print 20. (Whitespace are defined as one of ASCII characters [32, 9, 10, 11, 12, 13].)

\$\endgroup\$
2
\$\begingroup\$

Day 24, ABC, score 2(?)

IF	 1<3:	
	PUT	 'BAB'|	0	 IN	 aba
IF	 1<3:	
	PUT	 'BAB'|	0	 IN	 cbc
IF	NOT	(aba<cbc OR	 cbc<aba ):	
	PUT	 aba IN	 ebe
IF	 1<3:	
	PUT	 '2'^'4' IN	 gdg
IF	 1<3:	
	PUT	 '2'^'4' IN	 idi
IF	NOT	(gdg<idi OR	 idi<gdg ):	
	PUT	 gdg IN	 kdk
WRITE ebe^kdk

Try it online!

  • Bytes are odd, even, odd even, odd, even
  • Edit distance 1 print 24 or fail to print number (Not sure if it works...)

I'm not sure if the edit distance restriction works. But it seems to be:

  • Make any if condition false skip variable declaration. And the program won't run.
  • Change value of aba, cbc, ada, cdc cause the equal check fail.
  • The most terrible line is the last one:
    • Anyway, break WRITE simply break writing
    • Break variable name cause undefined variable error
    • Remove ^ cause undefined variable error
    • Change ^ to other single character operator, they won't work on two string
    • change ^ to ^^, it won't work on two string
    • comment out ^kdk print nothing
    • Insert # convert a operand of ^ to integer and fail

First, I want declare two variables as 24. Check if they are equal and then print one of them. Since I cannot use main, nor print, io, echo, out. But puts and write are available. Then go to language list to find a language use write or puts. Tcl works but it require set to define a variable. After that, I noticed that ABC work, as put and in are all valid words in such restriction...

Also

  • Write an integer won't work: inserting - will still yield valid output
  • Write a string won't work too: # may be inserted which is an operator calculates length of string
  • When write a expression, be careful it may not print numbers when \ is inserted (\ is the starting of line wise comment.)
  • Variables may not be single byte. Or it is easy to edit.

Tomorrow: Exist a number n (n >= 1), your each bytes mod n result a continuously increasing sequence.

Let's say your program contains \$ k \$ bytes \$ b_1 \dots b_k \$. Then \$ \exists n \in \mathbb{N}^+ : \forall i=1\dots k-1 : b_{i+1} \mod n = \left(b_{i} \mod n\right) + 1 \$.

\$\endgroup\$
2
  • \$\begingroup\$ I will try my best to fix it if some one find out a way to corrupt the edit distance restriction. \$\endgroup\$
    – tsh
    Dec 25 '20 at 9:58
  • \$\begingroup\$ I had also tried BF like language. But it failed since you can simply terminate program by inserting , in it with most implementation. So a single byte BF replacement not work. And Ook!, Blub do not work with the odd-even restriction. Unary like language would work. But I don't find out one not yet used. \$\endgroup\$
    – tsh
    Dec 25 '20 at 10:16
1
\$\begingroup\$

Day 3, Seriously, score 6

3

Try it online!

Just a copy of tsh's answer which follows the exact same restrictions:

  • The bytes of the program, when sorted and duplicates removed, are all consecutive [There is one lonely byte]
  • Programs must be pristine [Well, there is one byte only, so...]
  • The program is palindromic line-wise [My restriction is 2 ez for everyone]
  • The program's length [1] is no more than its lowest byte [51]
  • The output does not change when /* is added to the beginning. [Thank goodness it ActuallyFind the pun works]
  • The source code is valid UTF-8 stream. (I honestly do not know what this means, but it is followed by tsh's answer)

Since I copied my answer, day 4 programs should contain at least 3 previous programs already submitted to this post (question)!


I also know nothing about this language. tsh's hypothesis is correct!

\$\endgroup\$
4
  • 1
    \$\begingroup\$ Does that only include programs from days 1-3, or also programs that will get submitted in day 4? Also, can the 3 included programs overlap? \$\endgroup\$
    – NieDzejkob
    Dec 4 '20 at 22:53
  • \$\begingroup\$ Sorry for the late reply, but only from days 1-3. \$\endgroup\$
    – SunnyMoon
    Dec 5 '20 at 9:49
  • \$\begingroup\$ How many previous programs does the string 333454353 count for? \$\endgroup\$
    – NieDzejkob
    Dec 5 '20 at 10:44
  • \$\begingroup\$ It contains 6 programs. (5 3's plus 1 333454353) \$\endgroup\$
    – SunnyMoon
    Dec 5 '20 at 10:46
1
\$\begingroup\$

Day 5. CJam, score 2 1

4)

Try it online!

This satisfies the restrictions:

  • Any source code with an edit distance of 1 to your source code (by inserting 1 byte / deleting 1 byte / replacing 1 byte) should not fit this question's requirement (print 5) in the same language. [I could not find any program with an edit distance of one with 4)] Apparently my program does not follow this restriction. (I still do not have an idea why)

  • Answers today may follow half or less of all the other restrictions. [( ͡° ͜ʖ ͡°) <Insert boss music here>]

Tomorrow, answers should not contain 6 (0x54) or any acknowledgment (0x06).


To satisfy the edit distance restriction, I typed a random key. It turned out to be the closing parenthesis, which apparently in CJam is the increment operator! (I have never touched this language before)

\$\endgroup\$
9
  • \$\begingroup\$ What restriction for tommorrow? \$\endgroup\$ Dec 6 '20 at 17:04
  • \$\begingroup\$ Welp, the restriction is now edited. \$\endgroup\$
    – SunnyMoon
    Dec 6 '20 at 17:30
  • \$\begingroup\$ You don't satisfy the edit distance restriction. Counterexample: 4) . \$\endgroup\$
    – NieDzejkob
    Dec 6 '20 at 18:09
  • \$\begingroup\$ @NieDzejkob Doesn't 4) have an edit distance of zero? \$\endgroup\$ Dec 6 '20 at 18:17
  • \$\begingroup\$ @pppery Argh, damn markdown. Add a space at the end. \$\endgroup\$
    – NieDzejkob
    Dec 6 '20 at 18:20
1
\$\begingroup\$

Day 7, Glypho, score 1

ââäàââäàââäàââäàââäàââäàââäàâääââääââääââääââääââääââäää

Try it online!

Sorry, I should have posted an answer to this challenge yesterday, but I forgot. I'm back now, though. This follows the only restriction:

  • Your answer should not be an empty program and may only use bytes in range 128 to 255

Answers tommorrow may use the restriction that the program also produces the correct value if you increase every byte by one.

\$\endgroup\$
2
  • \$\begingroup\$ Do you mean another program P' which also produce the correct result while len(P') == len(P), and for each bytes P'[i] in P', P'[i] > P[i]? \$\endgroup\$
    – tsh
    Dec 8 '20 at 1:47
  • \$\begingroup\$ No, I meant that if you increase every byte by one the answer doesn't change. I apparently suck at writing clear restrictions. \$\endgroup\$ Dec 8 '20 at 1:54
1
\$\begingroup\$

Day 8, JShell, score 2

//:Rxrsdl-nts-oqhmskm'7(:.dwhs  
System.out.println(8);/exit
tixe/;)8-(nltnirp.tuo.metsyS;00

xxd:

00000000: 2f2f 3a52 7872 7364 6c2d 6e74 732d 6f71  //:Rxrsdl-nts-oq
00000010: 686d 736b 6d27 3728 3a2e 6477 6873 090a  hmskm'7(:.dwhs..
00000020: 5379 7374 656d 2e6f 7574 2e70 7269 6e74  System.out.print
00000030: 6c6e 2838 293b 2f65 7869 740a 7469 7865  ln(8);/exit.tixe
00000040: 2f3b 2938 2d28 6e6c 746e 6972 702e 7475  /;)8-(nltnirp.tu
00000050: 6f2e 6d65 7473 7953 3b30 300a            o.metsyS;00.

As it's day 8, no body had posted Java codes on this thread yet...

Seems TIO didn't include this language... You can test it by: Save above xxd as some_file, and execute

xxd some_file > some.jsh
jshell some.jsh

I'm using java 11.0.8 2020-07-14 LTS in case it matters.

  • The program also produces the correct value if you increase every byte by one.
  • When reverse your program, it should print -8 (as in day 8).

Plus by one:

00000000: 3030 3b53 7973 7465 6d2e 6f75 742e 7072  00;System.out.pr
00000010: 696e 746c 6e28 3829 3b2f 6578 6974 0a0b  intln(8);/exit..
00000020: 547a 7475 666e 2f70 7675 2f71 736a 6f75  Tztufn/pvu/qsjou
00000030: 6d6f 2939 2a3c 3066 796a 750b 756a 7966  mo)9*<0fyju.ujyf
00000040: 303c 2a39 2e29 6f6d 756f 6a73 712f 7576  0<*9.)omuojsq/uv
00000050: 702f 6e66 7574 7a54 3c31 310b            p/nfutzT<11.

Reversed:

00000000: 0a30 303b 5379 7374 656d 2e6f 7574 2e70  .00;System.out.p
00000010: 7269 6e74 6c6e 282d 3829 3b2f 6578 6974  rintln(-8);/exit
00000020: 0a74 6978 652f 3b29 3828 6e6c 746e 6972  .tixe/;)8(nltnir
00000030: 702e 7475 6f2e 6d65 7473 7953 0a09 7368  p.tuo.metsyS..sh
00000040: 7764 2e3a 2837 276d 6b73 6d68 716f 2d73  wd.:(7'mksmhqo-s
00000050: 746e 2d6c 6473 7278 523a 2f2f            tn-ldsrxR://

Tomorrow: Your source code should not contain duplicate bytes. That is to say, your source code should not contain two bytes which have the same byte value.

\$\endgroup\$
1
\$\begingroup\$

Day 9, MathGolf, score 2

9

Try it online!

Satisfies all the restrictions :D

  • Programs must include no characters that are used in day 8 answers. [Nobody uses 9 :(]
  • Your source code should not contain duplicate bytes. That is to say, your source code should not contain two bytes which have the same byte value. [There is only one byte]

The restriction for tommorrow is that programs should only use characters that are alphanumeric.


Here is a meme for anyone interested:

enter image description here

\$\endgroup\$
2
  • 1
    \$\begingroup\$ That's a bad example image, because what matters here is implicit output, not implicit input \$\endgroup\$ Dec 10 '20 at 20:29
  • \$\begingroup\$ That was honestly sort of the joke, but whatever. (My brother said that it is funnier if the I/O is switched) \$\endgroup\$
    – SunnyMoon
    Dec 10 '20 at 21:07
1
\$\begingroup\$

Day 10, Jolf, score 2

t
  • programs should only use characters that are alphanumeric
  • source code is only 1 byte long

Try it

Wow! I finally find out this!

Tomorrow:

Your source code does not contains any bytes in range 48~57, 65~70, 97~102. (0-9A-Fa-f).

\$\endgroup\$
1
\$\begingroup\$

Day 10, ><>, score 1

ann

Try it online!

Satisfies only the alphanumeric restriction.

Answers tommorrow may use the restriction that they contain an odd number of odd bytes and a nonzero even number of even bytes.

\$\endgroup\$
1
\$\begingroup\$

Day 11, Excel, score 2

=NOT(G:G)+NOT(G:G)+NOT(G:G)+NOT(G:G)+NOT(G:G)+NOT(G:G)+NOT(G:G)+NOT(G:G)+NOT(G:G)+NOT(G:G)+NOT(G:G)
  • contain an odd number (55) of odd bytes and a nonzero even number (44) of even bytes
  • does not contains any bytes in range 48~57, 65~70, 97~102

Today is an easy day.


Tomorrow: Your source code is exactly 1024 bytes long. And the program will not work as this question required if any single byte is removed from your source code.

\$\endgroup\$
1
\$\begingroup\$

Day 11, Morsefuck, score 2

.-..-..-..-..-..-..-..-..-..-..-.

Contains 22 . (codepoint 46) and 11 - (codepoint 45) characters. Equivalent brainfuck: ............

Satisfies both restrictions.

Answers tomorrow may use the restriction that it is possible to produce a valid answer by deleting exactly 2 nonconsecutive bytes.

\$\endgroup\$
1
\$\begingroup\$

Day 12, Minkolang, score 2

############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################v
############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################>93+N.

Satisfies both restrictions (Removing any of the # or the newline disconnects the v from the >, causing the code to infinite loop. Removing the v, the > or the . likewise causes an infinite loop. Removing any other characters changes the output. You can, however, remove two # characters without changing the result)

Answers tomorrow may use the restriction that the code contains more even bytes than odd bytes and breaks if any number of even bytes are deleted.

Try it online!

\$\endgroup\$
1
\$\begingroup\$

Day 12, ksh, score 2

print 12''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Try it online!

Satisfies both criteria:

  • removing any single character breaks the program (breaks print, prints the wrong number, or quotes become unbalanced)
  • removing any two non-consecutive single-quotes does not break the program

New criterion for tomorrow:

Your program must contain no ASCII spaces or line feeds.

\$\endgroup\$
0
1
\$\begingroup\$

Day 14, Make, score 1

$(info 14)#平均

Try it online!

  • Byte average = 107.5 > 100

After quite a lot of searching, I got 4 languages may output 14 for source code E. But none of theme works for e. So I had to give up a score 2 answer. After that, it could be very easy since you just need to pad some more bytes for an average value greater than 100.


Tomorrow:

Your source code is at least 2 bytes long and the standard deviation of bytes in your source code should be greater than 50.

Suppose your source code contains \$n\$ bytes \$b_1...b_{n}\$ (\$n>1\$). Standard deviation \$\sigma\$ is defined as

$$ \sigma = \sqrt{\frac{1}{n-1}\sum_i(b_i-\bar{b})^2} $$

$$ \bar{b} = \frac{\sum_i b_i}{n} $$

You can calculate it using following Python 3 code snippet:

import numpy as np

source_code = b'print(15)'
print(np.std(list(source_code)))

Try it online!

(In case I have any typo in the formula, follow the Python code.)

\$\endgroup\$
1
  • \$\begingroup\$ 平均 means Average lol \$\endgroup\$
    – pxeger
    Dec 16 '20 at 14:22
1
\$\begingroup\$

Day 14, TypeScript, score 1

console.log(~~~~~~~~14)

Try it online!

Byte average is \$\approx100.565\$.

Restriction for tomorrow:

Your code must still work when a certain character (of your choosing) is inserted at any point in the program. E.g. if your program is abc and you choose :, then all of abc, :abc, a:bc, ab:c, and abc: must work.

\$\endgroup\$
3
  • \$\begingroup\$ is "any point" consider byte or characters? (If I use multi-byte characters, will it be inserted in the middle of a character?) \$\endgroup\$
    – tsh
    Dec 16 '20 at 1:46
  • \$\begingroup\$ @tsh no, between characters. (but you can't invent a character set that has print 15 as a single character) \$\endgroup\$
    – pxeger
    Dec 16 '20 at 11:07
  • \$\begingroup\$ The charset had to be created before this question post otherwise it is a standard loophole. So maybe you do not need to worry about it. By the way, Unicode character "𰻝" does make "⿺‌辶⿳穴⿰月⿰⿲⿱幺长⿱言马⿱幺长刂心" as a single character. \$\endgroup\$
    – tsh
    Dec 16 '20 at 13:05
1
\$\begingroup\$

Day 15, Tir, score 3

7 8+zzzzzz

Try it online!

Notice that 3 null bytes at the end of source code.

  • standard deviation of bytes = 50.77 > 50
  • work when space ( ) is inserted at any point in the program
  • do not contain any characters used in Day 14

Just search the TIO and finally find out one.


Tomorrow:

Consider any sub-sequence bytes of your source code: There are exactly 15 (original source code not included in these 15 sub-sequence) sub-sequence work as this question required (print 16).

For example, your source code is ABCDE then , A, B, AB, C, AC, BC, ABC, D, AD, BD, ABD, CD, ACD, BCD, ABCD, E, AE, BE, ABE, CE, ACE, BCE, ABCE, DE, ADE, BDE, ABDE, CDE, ACDE, BCDE, are sub-sequence of your source code. And there should be exactly 15 of them work.

Another example, suppose your source code is ABABCDE. ABCDE is 1 sub-sequence of your source code. And ABCDE should not be count as 3 sub-sequences.

\$\endgroup\$
1
  • \$\begingroup\$ I just noticed that the most terrible thing happened here is there are too many sub-sequences. And it could be very hard to verify each sub-sequence works one by one. But... anyway, just leave this puzzle to the next day. \$\endgroup\$
    – tsh
    Dec 16 '20 at 8:26
1
\$\begingroup\$

Day 15, Unibrain, score 3

zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzz zzzzz               

The character between each set of zzzs is a tab character, and there are four trailing tabs.

Satisfies all three restrictions:

  • standard deviation of bytes = 50.47 > 50
  • works when tilde (~) (or any other non-whitespace, non-alphanumeric character) is inserted at any point in the program
  • does not contain any characters used in Day 14.

Answers tommorrow may use the restriction that, for every number between 1 and 15 inclusive, there must be a subsequence of the program that prints that number.

\$\endgroup\$
1
\$\begingroup\$

Day 15, emotifuck, score 3

😂😂😂😂😂😂😂🌚🔥😂😂😂😂😂😂😂💯💩🐸🔥💞😂😂😂😂💞!!!!!!

Emotifuck is a trivial brainfuck substitution. The normal version is:

+++++++[>+++++++<-]>.++++.!!!!!!

Multiply 7 by 7 to get ASCII 1 (decimal codepoint 49), print, add 4, and print.

The exclamation marks do nothing except ensure that

  • The standard deviation of the bytes is \$\approx50.507\$

Also

  • Works if any non-emoji character is inserted anywhere in the program.
  • Does not contain any characters used on Day 14.

Try it online!

Restriction for tomorrow:

The program must include at least one character* from every previous answer to this challenge (up to and including day 15)

*some languages (e.g. Bubblegum) do not have an encoding with characters. In this case, you can ignore that answer.

\$\endgroup\$
1
\$\begingroup\$

Day 16, CoffeeScript 1, score 3

ä=console;文="NPFX!=0.29134 nt";ä.log(文.length)###############

Try it online!

I hope this works....

  • include at least one character from every previous answer
    • This does not include the answer in Bubblegum and Unary (to my understand)
  • subsequences for each number between 1 and 15 inclusive
    • Just remove some character in the string
  • 15 subsequences works
    • Only # may be removed. And there are 15 #s
    • Remove part of multi-byte characters cause invalid variable
    • Remove anything in the string make it result incorrectly
    • Remove any part of console or log break the output
    • Remove part or whole .length make it print other values
    • Remove others may also cause syntax errors

Some one posted a TypeScript answer a few days ago. And I realized that I can post another CoffeeScript answer. Another variance of JavaScript.


Tomorrow: Your source code contains at least 2 non-empty lines. The byte sum of each line (excluding line breaks) should be equal. But any two line should not share same characters. A trailing empty new line may be allowed in your source code which didn't count as a line in this restriction.

\$\endgroup\$
2
  • \$\begingroup\$ "any two line should not share same characters" - does this mean no characters in common between lines, or no exact duplicate lines? \$\endgroup\$
    – pxeger
    Dec 17 '20 at 20:53
  • \$\begingroup\$ @pxeger no characters in common between lines. both ABC\nCBA, ABI\nEFA are invalid. And AAD\nBBB is valid. \$\endgroup\$
    – tsh
    Dec 18 '20 at 1:23
1
\$\begingroup\$

Day 16, FuckbeEs, score 2

bbbbbbbbbbbbbbbbccccccccccccccc

Try it online!

Satisfied restrictions:

  • Subsequences for each number between 1 and 15 inclusive
    • This program outputs in Unary, with each b contributing 1 character. Removing a b results in 15, 2 bs results in 14, and so on.
  • 15 subsequences works
    • Removing cs at the end does nothing. This satisfies the restriction in the same way as the 15 # in tsh's answer.

Answers tommorrow may use the restriction that the number of bytes they have is a power of 17.

\$\endgroup\$
3
  • \$\begingroup\$ I'm pretty sure you can manage to fit the third restriction. \$\endgroup\$
    – pxeger
    Dec 17 '20 at 20:45
  • \$\begingroup\$ No, I can't easily with this approach, because if the "fluff" characters not recognized by fuckbeEs aren't distinct then the number of working subsequences becomes too high. \$\endgroup\$ Dec 17 '20 at 20:47
  • \$\begingroup\$ (I meant "aren't the same", not "are distinct") \$\endgroup\$ Dec 17 '20 at 22:12
1
\$\begingroup\$

Day 16, Elixir, score 3

s='!nz})~9」5äA3FXP0';IO.puts length s###############

Try it online!

More or less a direct port of @tsh's answer.


Restriction for tomorrow:

Answers may not be valid UTF-8, as understood by Python 3.9's bytes.decode with errors="strict"

\$\endgroup\$
3
  • \$\begingroup\$ Will this work if a byte from orä got removed? I just don't know how to test this on tio. \$\endgroup\$
    – tsh
    Dec 18 '20 at 1:28
  • \$\begingroup\$ @tsh No because that would break the UTF-8 encoding (I just tested it in a Python interpreter) \$\endgroup\$
    – pxeger
    Dec 18 '20 at 7:08
  • \$\begingroup\$ My CoffeeScript answer seem still work if the UTF-8 encoding is broken (in a string literal). That's why I use these two characters as variable names. \$\endgroup\$
    – tsh
    Dec 18 '20 at 8:12
1
\$\begingroup\$

Day 17, Windows CMD, score 3

@echo 17
::?AAAPP

xxd:

00000000: 4065 6368 6f20 3137 0a3a 3aff 4141 4150  @echo 17.::.AAAP
00000010: 50                                       P

The ? is for \xff as what I did in the vim answer.

  • invalid UTF-8 (\xff)
  • 171 bytes
  • same byte sum each line, no dupe char between lines

Sounds quite easy today.


To make it more complex tomorrow:

Your source code contains multiple lines. No duplicate characters between lines. No empty lines. The bytes' product (multiplication) of each line should be equal. A trailing empty new line may allowed in your answer which doesn't count a line to this question. Line breaks does not belong to any line as in this restriction.

\$\endgroup\$
1
\$\begingroup\$

Day 17, ;#+, score 3

;;;;~++++;
p8899ÿ

Satisfies all 3 restrictions:

  • invalid UTF-8 (the ÿ at the end is a \xff byte)
  • 171 bytes
  • same byte sum (538) each line, no dupe char between lines

Answers tomorrow may use the restriction that there are no bytes less than or equal to 5.

Try it online!

\$\endgroup\$
1
\$\begingroup\$

Day 17, Python 1, score 3

print 17
#||4!!%ÿ

Try it online!

ÿ is a 0xFF byte. (I don't know how to get invalid UTF-8 into TIO or StackExchange, so I put in the character with Unicode codepoint 0xFF instead)


Restriction for tomorrow:

Your program must by a polyglot in Markdown, so that when rendered to HTML by StackExchange's parser, it looks like the following; the parts in italics are placeholders which you can replace with any non-empty unformatted text. The links must be clickable but do not necessarily have to lead anywhere.


Day 18, SOME LANGUAGE, score N

SOME CODE

Try it online!

EXPLANATION PARAGRAPH


Restriction for tomorrow:

EXPLANATION PARAGRAPH 2

I hope this is clear enough, now go and read up on Markdown's various alternative syntaxes! Style points if you can make it exactly the same text as your post.

\$\endgroup\$
3
  • \$\begingroup\$ Do you mean when paste my source code into SO's answer box, it render the same thing as you mentioned above? Including the text exactly "SOME CODE", "EXPLANATION PARAGRAPH" ... \$\endgroup\$
    – tsh
    Dec 18 '20 at 8:09
  • \$\begingroup\$ @tsh, no, it should have something else in place of "SOME CODE" etc., but with no extra formatting. The italic parts are placeholders for your code. \$\endgroup\$
    – pxeger
    Dec 18 '20 at 8:19
  • \$\begingroup\$ @tsh Ah, I see the misunderstanding. I want your source code to be in Python (for example), but if you put the raw source code into a Markdown parser it would produce some content that looks like the above. A Python-Markdown polyglot. (or any other language than Python). I've clarified the answer \$\endgroup\$
    – pxeger
    Dec 18 '20 at 8:28
1
\$\begingroup\$

Day 18, Emoji, score 2

# Day 18, [Emoji], score 2

    💬18💬➡

[Try it online!][TIO-kivh57t8]

[Emoji]: https://esolangs.org/wiki/Emoji
[TIO-kivh57t8]: https://tio.run/##S83Nz8r8///D/ElrDC1A5KN5C///BwA "Emoji – Try It Online"

I cannot make this markdown render works with milti-line codes while not sharing characters between lines. So I think it is impossible to get a score 3.

> Restriction for tomorrow:<p>Your source code should be valid UTF-8 stream. And when decode as UTF-8, it is at least 8 characters long and contains at least one uppercase letter, one lowercase letter, one numeric character, and one character not belongs to any above sections. For more details, it could be defined as [this Python code](https://tio.run/##XY4/CsIwGMX3nuKjUwLFxUUK9SLiENMUA2kS0hTpqDfQraPQwTNIexoH3XKEWPrHguP73u997@nKHpVce1@o0lAGCYSubVx3dl3t2qtr69fl9rk/3s0zDAJKbE/sCmtWvCi1ZiaCUQh1WoQsc2Y43QdUSUu47DOC5IeUwNgSzzKLgcgK5USjLJpMjANtuLRIMImmE2wT2PRoCkSIAZ8@z0AE/TSMB@TPQlMXjUEq@@tbFmSIznmMvf8C).

Try it online!

I cannot make this markdown render works with milti-line codes while not sharing characters between lines. So I think it is impossible to get a score 3.


Tomorrow: Your source code should be valid UTF-8 stream. And when decode as UTF-8, it is at least 8 characters long and contains at least one uppercase letter, one lowercase letter, one numeric character, and one character not belongs to any above sections. For more details, it could be defined as this Python code.

\$\endgroup\$
1
\$\begingroup\$

Day 18, Foo, score 2

# Day 18, [Foo], score 2

    "18"

Satisfies the markdown polyglot and the no bytes less than or equal to 5 restrictions.


[Try it online!][TIO-kivtlq6s]

Restriction for tomorrow:
> Every byte must have it's index in the program as a factor (the first byte can be anything, the second byte must be divisible by two, the third byte must be divisible by three, and so on).

[Foo]: https://esolangs.org/wiki/Foo
[TIO-kivtlq6s]: https://tio.run/##S8vP//9fydBC6f9/AA

Satisfies the markdown polyglot and the no bytes less than or equal to 5 restrictions.

Try it online!

Restriction for tomorrow:

Every byte must have it's index in the program as a factor (the first byte can be anything, the second byte must be divisible by two, the third byte must be divisible by three, and so on).

\$\endgroup\$
4
  • \$\begingroup\$ Is null byte allowed anywhere or nowhere? \$\endgroup\$
    – tsh
    Dec 20 '20 at 2:46
  • \$\begingroup\$ I completely didn't think about what to do with null bytes when writing the restriction. Let's say they can be anywhere because, if I were to choose nowhere, then "the first byte can be anything" would be false. \$\endgroup\$ Dec 20 '20 at 3:23
  • \$\begingroup\$ So, Unary like language would be quite easy today... \$\endgroup\$
    – tsh
    Dec 20 '20 at 3:47
  • \$\begingroup\$ True, but I think I've used all the Unary variants already. \$\endgroup\$ Dec 20 '20 at 3:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.