Skip to main content
2 of 8
added 29 characters in body
MD XF
  • 13.9k
  • 4
  • 66
  • 104

Byte sum quines

"quines" is plural due to the annoying 15-character title limit.

All the challenges on this site are focused on byte count, or the characters themselves. This one is different. Your challenge is to write a program that produces output which has a byte sum identical to the source code's byte sum.

To produce a byte sum:

  1. Find the values of the characters in the program's character set.
    For example - FOO in ASCII: F = 70, O = 79, O = 79
  2. Add them all together.
    Byte sum of FOO in ASCII: F+O+O = 70+79+79 = 228.

An example of an ASCII byte sum quine would be if the source code was ABC and the output was !!!!!!. This is because the sum of the the ASCII values of the source (A = 65, B = 66, C = 67, sum = 198) is the same as the sum of the ASCII values in the output (! = 33, 33*6 = 198). BBB would also be valid output, as would cc.

Rules

  • Your program must not be a reverse, shuffled, error, or any other type of "true" quine. To elaborate: If the output contains all the same characters as the source, it is invalid.
  • Your program cannot generate any errors/warnings from the compiler/interpreter.
  • Your program's source must use the same codepage as the output.
  • Your program may use any codepage that was created before this challenge was.
  • Your program's output must not contain any unprintable characters (e.g. ASCII 0 through 31, or above 127) aside from linefeeds and tabs.
  • Standard loopholes apply.

Scoring

Shortest answer in byte count (not byte sum) wins. Please use this header format answers:

# Jelly, 12 bytes, byte sum 56 (SBCS)

Reference

Here are some useful codepage references.

MD XF
  • 13.9k
  • 4
  • 66
  • 104