Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

deleted 560 characters in body
Source Link
Laikoni
  • 26.4k
  • 7
  • 54
  • 116

Haskell + CPP, line length 2, 705(削除) 705 (削除ここまで) 237 bytes

m\
a\
i\
n\
=\
p\
u\
t\
S\
t\
r\
$\
s\
+\
+\
(\
(\
:\
"\
\\
\\
\\
n\
"\
)\
=\
<\
<\
s\
+\
+\
s\
h\
o\
w\
 \
s\
)\
;\
s\
=\
"\
m\
\\
\\
\\
n\
a\
\\
\\
\\
n\
i\
\\
\\
\\
n\
n\
\\
\\
\\
n\
=\
\\
\\
\\
n\
p\
\\
\\
\\
n\
u\
\\
\\
\\
n\
t\
\\
\\
\\
n\
S\
\\
\\
\\
n\
t\
\\
\\
\\
n\
r\
\\
\\
\\
n\
$\
\\
\\
\\
n\
s\
\\
\\
\\
n\
+\
\\
\\
\\
n\
+\
\\
\\
\\
n\
(\
\\
\\
\\
n\
(\
\\
\\
\\
n\
:\
\\
\\
\\
n\
\\
"\
\\
\\
\\
n\
\\
\\
\\
\\
\\
n\
\\
\\
\\
\\
\\
n\
\\
\\
\\
\\
\\
n\
n\
\\
\\
\\
n\
\\
"\
\\
\\
\\
n\
)\
\\
\\
\\
n\
=\
\\
\\
\\
n\
<\
\\
\\
\\
n\
<\
\\
\\
\\
n\
s\
\\
\\+\
\\+\
n\s\
h\
\\
\\
\\
n\
o\
\\
\\
\\
n\
w\
\\
\\
\\
n\
 \
\\
\\
\\
n\
s\
\\
\\
\\
n\
)\
\\
\\
\\
n\
;\
\\
\\
\\
n\
s\
\\
\\
\\
n\
=\
\\
\\
\\
n\
"\

Try it online! Try it online! Using the flag -CPP which enables the C pre-processor allows us to use a backslash at the end of a line to continue it on the next line.

The actual code is main=putStr$s++(main=putStr$(:"\\\n")=<<show=<<s++show s);s="<data>"s;s="<data>".

Edit: A casual -468 bytes thanks to Ørjan Johansen !

Haskell + CPP, line length 2, 705 bytes

m\
a\
i\
n\
=\
p\
u\
t\
S\
t\
r\
$\
s\
+\
+\
(\
(\
:\
"\
\\
\\
\\
n\
"\
)\
=\
<\
<\
s\
h\
o\
w\
 \
s\
)\
;\
s\
=\
"\
m\
\\
\\
\\
n\
a\
\\
\\
\\
n\
i\
\\
\\
\\
n\
n\
\\
\\
\\
n\
=\
\\
\\
\\
n\
p\
\\
\\
\\
n\
u\
\\
\\
\\
n\
t\
\\
\\
\\
n\
S\
\\
\\
\\
n\
t\
\\
\\
\\
n\
r\
\\
\\
\\
n\
$\
\\
\\
\\
n\
s\
\\
\\
\\
n\
+\
\\
\\
\\
n\
+\
\\
\\
\\
n\
(\
\\
\\
\\
n\
(\
\\
\\
\\
n\
:\
\\
\\
\\
n\
\\
"\
\\
\\
\\
n\
\\
\\
\\
\\
\\
n\
\\
\\
\\
\\
\\
n\
\\
\\
\\
\\
\\
n\
n\
\\
\\
\\
n\
\\
"\
\\
\\
\\
n\
)\
\\
\\
\\
n\
=\
\\
\\
\\
n\
<\
\\
\\
\\
n\
<\
\\
\\
\\
n\
s\
\\
\\
\\
n\
h\
\\
\\
\\
n\
o\
\\
\\
\\
n\
w\
\\
\\
\\
n\
 \
\\
\\
\\
n\
s\
\\
\\
\\
n\
)\
\\
\\
\\
n\
;\
\\
\\
\\
n\
s\
\\
\\
\\
n\
=\
\\
\\
\\
n\
"\

Try it online! Using the flag -CPP which enables the C pre-processor allows us to use a backslash at the end of a line to continue it on the next line.

The actual code is main=putStr$s++((:"\\\n")=<<show s);s="<data>".

Haskell + CPP, line length 2, (削除) 705 (削除ここまで) 237 bytes

m\
a\
i\
n\
=\
p\
u\
t\
S\
t\
r\
$\
(\
:\
"\
\\
\\
\\
n\
"\
)\
=\
<\
<\
s\
+\
+\
s\
h\
o\
w\
 \
s\
;\
s\
=\
"\
m\
a\
i\
n\
=\
p\
u\
t\
S\
t\
r\
$\
(\
:\
\\
"\
\\
\\
\\
\\
\\
\\
n\
\\
"\
)\
=\
<\
<\
s\
+\
+\
s\
h\
o\
w\
 \
s\
;\
s\
=\
"\

Try it online! Using the flag -CPP which enables the C pre-processor allows us to use a backslash at the end of a line to continue it on the next line.

The actual code is main=putStr$(:"\\\n")=<<s++show s;s="<data>".

Edit: A casual -468 bytes thanks to Ørjan Johansen !

Source Link
Laikoni
  • 26.4k
  • 7
  • 54
  • 116

Haskell + CPP, line length 2, 705 bytes

m\
a\
i\
n\
=\
p\
u\
t\
S\
t\
r\
$\
s\
+\
+\
(\
(\
:\
"\
\\
\\
\\
n\
"\
)\
=\
<\
<\
s\
h\
o\
w\
 \
s\
)\
;\
s\
=\
"\
m\
\\
\\
\\
n\
a\
\\
\\
\\
n\
i\
\\
\\
\\
n\
n\
\\
\\
\\
n\
=\
\\
\\
\\
n\
p\
\\
\\
\\
n\
u\
\\
\\
\\
n\
t\
\\
\\
\\
n\
S\
\\
\\
\\
n\
t\
\\
\\
\\
n\
r\
\\
\\
\\
n\
$\
\\
\\
\\
n\
s\
\\
\\
\\
n\
+\
\\
\\
\\
n\
+\
\\
\\
\\
n\
(\
\\
\\
\\
n\
(\
\\
\\
\\
n\
:\
\\
\\
\\
n\
\\
"\
\\
\\
\\
n\
\\
\\
\\
\\
\\
n\
\\
\\
\\
\\
\\
n\
\\
\\
\\
\\
\\
n\
n\
\\
\\
\\
n\
\\
"\
\\
\\
\\
n\
)\
\\
\\
\\
n\
=\
\\
\\
\\
n\
<\
\\
\\
\\
n\
<\
\\
\\
\\
n\
s\
\\
\\
\\
n\
h\
\\
\\
\\
n\
o\
\\
\\
\\
n\
w\
\\
\\
\\
n\
 \
\\
\\
\\
n\
s\
\\
\\
\\
n\
)\
\\
\\
\\
n\
;\
\\
\\
\\
n\
s\
\\
\\
\\
n\
=\
\\
\\
\\
n\
"\

Try it online! Using the flag -CPP which enables the C pre-processor allows us to use a backslash at the end of a line to continue it on the next line.

The actual code is main=putStr$s++((:"\\\n")=<<show s);s="<data>".

AltStyle によって変換されたページ (->オリジナル) /