-2
\$\begingroup\$

A very simple golf this time, but should be fun to do.

Challenge

Output your code, but rotated 45 (or -45) degrees. E.g:

lorem ipsum dolor sit amet

becomes

                         t
                        e
                       m
                      a

                    t
                   i
                  s

                r
               o
              l
             o
            d

          m
         u
        s
       p
      i

    m
   e
  r
 o
l

This logic follows for newlines, too:

lorem ipsum dolor sit amet consectetur adipiscing

becomes

                         t
                        e
                       m
                      a
                       g
                    t n
                   i i
                  s c
                   s
                r i
               o p
              l i
             o d
            d a

          m r
         u u
        s t
       p e
      i t
       c
    m e
   e s
  r n
 o o
l c

Of course, the difficulty is that you have to output your own code in this format.

Scoring

Find position b (the amount of bytes in your code). on the X-axis of the formula \$y=\left(\frac{b}{8}-15\right)^2-n\$ (given n is the number of newlines). The lower the score, the better. Newlines are encouraged, as they made rendering it harder. Also, -15 bonus points for doing -45 degrees, as opposed to 45. My examples were -45 degrees.

Rules

  • Standard loopholes apply.
  • No reading your own source.
  • There must be a space between one line of code and the next, if you choose to do so
  • Every line must be at least 5 characters long.
  • Newlines cannot be replaced with '\n'. Tabs should be replaced with two spaces.
  • Every line must do something; when removed, the program must not work
  • No trailing newlines (unless for an implicit return) or no-ops.
  • Blank newlines should be rendered with a space in its place (you can assume its a line of contents ' ')
\$\endgroup\$
  • 2
    \$\begingroup\$ What does "There must be a space between one line of code and the next, if you choose to do so" mean? \$\endgroup\$ – dfeuer Mar 1 at 23:23
  • 2
    \$\begingroup\$ Also, the scoring system seems to mean that there's no point to having code under 120 bytes? \$\endgroup\$ – Jo King Mar 2 at 1:28
  • 3
    \$\begingroup\$ How does the scoring work? I feel like I did it wrong, I hv=ave the smallest byte count, but the highest score? My program fits all of the rules too! I feel like I'm missing something here... \$\endgroup\$ – KrystosTheOverlord Mar 2 at 3:48
  • 4
    \$\begingroup\$ Just FYI, this isn't code-golf anymore, it's code-challenge, since the criterion isn't strictly lowest byte count. \$\endgroup\$ – Rɪᴋᴇʀ Mar 2 at 4:32
  • 2
    \$\begingroup\$ I think what @dfeuer meant was whether the space between characters was optional or not, since you specify the conflicting statements There must be a space and if you choose to do so \$\endgroup\$ – Jo King Mar 2 at 11:15
2
\$\begingroup\$

Gol><>, 120 bytes, score 0

sP#|oao|o `FLFl                                                                                                        "

Adding a ton of no-ops makes my score really low, so I'm just going to go with it even though it hurts my heart to see so many no-ops doing absolutely nothing :(

Try it online!

golfed answer, 16 bytes, Score : 152?!

sP#|oao|o `FLFl"

Wow, that is much smaller and more correct than my previous answer!!! (my other ones were backwards!)

Try it online!

\$\endgroup\$
  • \$\begingroup\$ try adding no-ops till your byte count is 120, you'll have a score of 0 \$\endgroup\$ – Embodiment of Ignorance Mar 2 at 4:01
  • \$\begingroup\$ You can get a negative score if you combined no-ops with new lines \$\endgroup\$ – Embodiment of Ignorance Mar 2 at 4:09
  • \$\begingroup\$ @EmbodimentofIgnorance So basically if I am patient enough, and have enough time to waste, I can get an ridiculously low score?! \$\endgroup\$ – KrystosTheOverlord Mar 2 at 4:11
  • \$\begingroup\$ That is exactly what I'm saying, and why the current scoring system is broken. \$\endgroup\$ – Embodiment of Ignorance Mar 2 at 4:12
  • 2
    \$\begingroup\$ @EmbodimentofIgnorance I feel like the scoring should just be based off of bytes, and perhaps penalties for trailing newlines, rather than this weird equation \$\endgroup\$ – KrystosTheOverlord Mar 2 at 4:15
1
\$\begingroup\$

C# (Visual C# Interactive Compiler), Score 50.765625

var s="var s={0}{1}{0};for(int i=0;;)WriteLine(new String(' ',i)+string.Format(s,(char)34,s)[i++]);";for(int i=0;;)WriteLine(new String(' ',i)+string.Format(s,(char)34,s)[i++]);

Try it online!

Also prints to STDERR, if this is invalid I will change it.

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

Japt -S, 25 bytes, Score: 116

25Çî iRiZgQi"25Çî iRiZgQi

Run it online

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

Perl 6, Score -14

<+map
{say(
~($_,)
.indent(
$++))
},[Z]
"<$_>[]~~
.EVAL#1234567"
.words
.map:{
.fmt(
"%-14s"
).comb
}>[]~~
.EVAL#1234567

Try it online!

New solution since my old one (below) might (?) be invalidated by the new rules. The output looks like:

< { ~ . $ } " . . . . " ) } .
 + s ( i + , < E w m f % . > E
  m a $ n + [ $ V o a m - c [ V
   a y _ d ) Z _ A r p t 1 o ] A
    p ( , e ) ] > L d : ( 4 m ~ L
         ) n     [ # s {   s b ~ #
            t     ] 1       "     1
             (     ~ 2             2
                    ~ 3             3
                       4             4
                        5             5
                         6             6
                          7             7
                           "              

I'm not sure if this is valid output since there's no example of a normal 45 degree quine in the question itself (this one is mirrored as well as rotated).

Perl 6, Score: -8

<+map {say .indent($++),' 'x($++ <5)*16},"<$_>~~.EVAL".comb#123>>~~.EVAL
     
     
     
     
     
     
     
     

Try it online!

Pads the code by 8 lines of 5 space characters, and then adds trailing spaces to the first 5 lines.

\$\endgroup\$
  • \$\begingroup\$ Doesn't this break the rule Every line must be at least 5 characters long? \$\endgroup\$ – Emigna Mar 2 at 9:30
  • \$\begingroup\$ @Emigna Ah, missed that. Fixed \$\endgroup\$ – Jo King Mar 2 at 11:00
  • \$\begingroup\$ Nice! If this program is -14 bytes, I can just download it over and over again! Free storage! \$\endgroup\$ – Redwolf Programs Mar 3 at 4:50
  • \$\begingroup\$ @Redwolf This isn't code-golf, the score is from a (rather bad) formula which goes negative with enough newlines \$\endgroup\$ – Jo King Mar 3 at 5:42
0
\$\begingroup\$

Charcoal, 40 bytes, score 100

≔´α´↗´´´≔´F´α´↗´⁺´´´´´ι´↗´αα↗´≔Fα↗⁺´´ι↗α

Try it online!

Based off the standard Charcoal quine

\$\endgroup\$
  • \$\begingroup\$ 37 bytes: ≔´α´↶´¹´´´≔´F´α´⁺´´´´´ι´αα↶¹´≔Fα⁺´´ια \$\endgroup\$ – Neil Mar 2 at 11:13
  • \$\begingroup\$ @Neil Technically, you're just making the score worse :o \$\endgroup\$ – Jo King Mar 2 at 11:16
  • \$\begingroup\$ The reason for this is that making really short quines isn't really much of a challenge any more, so instead the longer it is the higher the score (for a little while) \$\endgroup\$ – Geza Kerecsenyi Mar 2 at 19:52
  • \$\begingroup\$ @GezaKerecsenyi Yeah that's not going to work... basically every single quine under our definition is payload-capable so they can be lengthened arbitrarily \$\endgroup\$ – ASCII-only Mar 2 at 22:32
  • \$\begingroup\$ Couldn't you add no-ops to make your score smaller (like spaces)? \$\endgroup\$ – MilkyWay90 Mar 3 at 4:28

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