Skip to main content
Commonmark migration
Source Link

#38. C, 804 bytes # 1"16" 3//v(@#/;n4"14" #/3 auaaZ<>16/"<"6/b.q@")(22)S# ␉␉␉␉ #yy␉;36!@ # ␉ #=␉> #[#yy#yy0l0mx01k1k0l0ix0jx0h0h1d111P0eU0bx0b0o1d0b0e0e00x1d0i0fx0g0n0n11x0o0n0cx0c0o0f0c0gx0g0f0h0j0j0i0001k10mx0m0l11111100(^_) #<␉| print((eval("1\x2f2")and( 9 )or(13 ))-(0and 4)^1<<(65)>>(62))or'(\{(\{})(\{}[()])}\{}\{}\{})'#46(8+9+9+9+9+=!)#1|=/=1/24=x=9[<$+@+-@@@@=>+<@@@=>+<?#>+.--.]/ __DATA__=1#// #.\."12"*␉ """"#// =begin␉// # #*/␉ #define␉z sizeof 'c'-1?"38":"37" #include␉<stdio.h> int main() /*/ #()#\'*/{puts(z);;}/*'`` $'main'␉// #-3o4o#$$$ <>3N.<>␉// #xx #x%~~~+␉+~*ttt*.x #xx =end #// """#"#// #0]#echo 21#/(\[FAC,1<-#2FAC,1SUB#1<-#52FAC,1SUB#2<-#32FACLEGEREEX,1PLEASEGIVEUPPLEASE) ap #_~nJ|#o51\ #0␛dggi2␛␉|1|6$//''25 >>>#>27.say# =#print(17)#^_^_7LEintndus({})!<>+]////Z222999/(3!@)"26

38. C, 804 bytes

#  1"16" 3//v\(@#/;n4"14"
#/*`3 auaaZ<>16/"<"6/b.q@")(22)S#  ␉␉␉␉ 
#yy␉;36!@
# ␉
#=␉>
#[#yy#yy0l0mx01k1k0l0ix0jx0h0h1d111P0eU0bx0b0o1d0b0e0e00x1d0i0fx0g0n0n11x0o0n0cx0c0o0f0c0gx0g0f0h0j0j0i0001k10mx0m0l11111100(^_)
#`<`␉|
print((eval("1\x2f2")and( 9 )or(13 ))-(0and 4)^1<<(65)>>(62))or'(\{(\{})(\{}[()])}\{}\{}\{})'#46(8+9+9+9+9+=!)#1|=/=1/24=x=9[<$+@+-@@@@=>+<@@@=>+<?#>+.--.]/
__DATA__=1#//
#.\."12"*␉
""""#//
=begin␉//
#
#*/␉
#define␉z  sizeof 'c'-1?"38":"37"
#include␉<stdio.h>
int main()  /*/
#()`#`\'*/{puts(z);;}/*'``
$'main'␉//
#-3o4o#$$$
<>3N.<>␉//
#xx
#x%~~~+␉+~*ttt*.x
#xx
=end   #//
"""#"#//
#0]#echo 21#/(\[FAC,1<-#2FAC,1SUB#1<-#52FAC,1SUB#2<-#32FACLEGEREEX,1PLEASEGIVEUPPLEASE)  ap
#_~nJ|#o51\   
#0␛dggi2␛`␉|1|6$//''25  >>>#>27.say# =#print(17)#^_^_7LEintndus({})!<>+]/*///Z222999/(3!@)"26

#38. C, 804 bytes # 1"16" 3//v(@#/;n4"14" #/3 auaaZ<>16/"<"6/b.q@")(22)S# ␉␉␉␉ #yy␉;36!@ # ␉ #=␉> #[#yy#yy0l0mx01k1k0l0ix0jx0h0h1d111P0eU0bx0b0o1d0b0e0e00x1d0i0fx0g0n0n11x0o0n0cx0c0o0f0c0gx0g0f0h0j0j0i0001k10mx0m0l11111100(^_) #<␉| print((eval("1\x2f2")and( 9 )or(13 ))-(0and 4)^1<<(65)>>(62))or'(\{(\{})(\{}[()])}\{}\{}\{})'#46(8+9+9+9+9+=!)#1|=/=1/24=x=9[<$+@+-@@@@=>+<@@@=>+<?#>+.--.]/ __DATA__=1#// #.\."12"*␉ """"#// =begin␉// # #*/␉ #define␉z sizeof 'c'-1?"38":"37" #include␉<stdio.h> int main() /*/ #()#\'*/{puts(z);;}/*'`` $'main'␉// #-3o4o#$$$ <>3N.<>␉// #xx #x%~~~+␉+~*ttt*.x #xx =end #// """#"#// #0]#echo 21#/(\[FAC,1<-#2FAC,1SUB#1<-#52FAC,1SUB#2<-#32FACLEGEREEX,1PLEASEGIVEUPPLEASE) ap #_~nJ|#o51\ #0␛dggi2␛␉|1|6$//''25 >>>#>27.say# =#print(17)#^_^_7LEintndus({})!<>+]////Z222999/(3!@)"26

38. C, 804 bytes

#  1"16" 3//v\(@#/;n4"14"
#/*`3 auaaZ<>16/"<"6/b.q@")(22)S#  ␉␉␉␉ 
#yy␉;36!@
# ␉
#=␉>
#[#yy#yy0l0mx01k1k0l0ix0jx0h0h1d111P0eU0bx0b0o1d0b0e0e00x1d0i0fx0g0n0n11x0o0n0cx0c0o0f0c0gx0g0f0h0j0j0i0001k10mx0m0l11111100(^_)
#`<`␉|
print((eval("1\x2f2")and( 9 )or(13 ))-(0and 4)^1<<(65)>>(62))or'(\{(\{})(\{}[()])}\{}\{}\{})'#46(8+9+9+9+9+=!)#1|=/=1/24=x=9[<$+@+-@@@@=>+<@@@=>+<?#>+.--.]/
__DATA__=1#//
#.\."12"*␉
""""#//
=begin␉//
#
#*/␉
#define␉z  sizeof 'c'-1?"38":"37"
#include␉<stdio.h>
int main()  /*/
#()`#`\'*/{puts(z);;}/*'``
$'main'␉//
#-3o4o#$$$
<>3N.<>␉//
#xx
#x%~~~+␉+~*ttt*.x
#xx
=end   #//
"""#"#//
#0]#echo 21#/(\[FAC,1<-#2FAC,1SUB#1<-#52FAC,1SUB#2<-#32FACLEGEREEX,1PLEASEGIVEUPPLEASE)  ap
#_~nJ|#o51\   
#0␛dggi2␛`␉|1|6$//''25  >>>#>27.say# =#print(17)#^_^_7LEintndus({})!<>+]/*///Z222999/(3!@)"26
Fix C/C++ compilation in Clang.
Source Link
Muzer
  • 423
  • 3
  • 5

#38. C, 802804 bytes # 1"16" 23//v(@#/;n4"14" #/3 auaaZ<>16/"<"6/b.q@")(22)S# ␉␉␉␉ #yy␉;36!@ # ␉ #=␉> #[#yy#yy0l0mx01k1k0l0ix0jx0h0h1d111P0eU0bx0b0o1d0b0e0e00x1d0i0fx0g0n0n11x0o0n0cx0c0o0f0c0gx0g0f0h0j0j0i0001k10mx0m0l11111100(^_) #<␉| print((eval("1\x2f2")and( 9 )or(13 ))-(0and 4)^1<<(65)>>(62))or'(\{(\{})(\{}[()])}\{}\{}\{})'#46(8+9+9+9+9+=!)#1|=/=1/24=x=9[<$+@+-@@@@=>+<@@@=>+<?#>+.--.]/ __DATA__=1#// #.\."12"*␉ """"#// =begin␉// # #*/␉ #define␉z sizeof 'c'-1?"38":"37" #include␉<stdio.h> int main() /*/ #()#\'*/{puts(z);;}/*'`` $'main'␉// #-3o4o#$$$ <>3N.<>␉// #xx #x%~~~+␉+~*ttt*.x #xx =end #// """#"#// #0]#echo 21#/(\[FAC,1<-#2FAC,1SUB#1<-#52FAC,1SUB#2<-#32FACLEGEREEX,1PLEASEGIVEUPPLEASE) ap #_~nJ|#o51\ #0␛dggi2␛␉|1|6$//''25 >>>#>27.say# =#print(17)#^_^_7LEintndus({})!<>+]////Z222999/(3!@"26@)"26

Try them online!Try them online!

Here is my slightly tweaked version of the Incident tokenisertokeniser, designed to be a bit less golfed but a bit more useful.

I have also tweaked the whitespace a little to change some other tokens to make some attempt at centring, to re-tokenise Tab Linefeed (by moving the tab at the end of the #include line to in the middle, thus making three tokens), and to de-tokenise the triple-space token by moving one space in the define line.

Finally, a day after initial submission, I decided to get to the bottom of the scary preprocessor warning that gcc produced (and which made Clang fail). I determined that the reason the first line worked at all is because it's the output from the preprocessor that provides debug info like original filenames and line numberings. They didn't like the first "2" on the first line, because this meant "returning from an included file into the given file", and obviously that's impossible given there haven't been any included files. After changing it to a "1" (start normal header) made a few too many languages choke, I changed it to a "3" (start internal component header), which broke only Hexagony, since it was now relying on the 2. So at the start of the Hexagony code I added an open bracket ( to decrement the 3 to a 2, then a close bracket ) after the end (@) of the hexagony code to satisfy Retina, Prelude and Underload which all expected matching brackets. Re-testing Reng and Modular SNUSP produced no issues, and the Incident tokens looked right, so I had now fixed it! I've tested it on a variety of exotic architectures and it appears to work. I know it's not important for a code golf, and I won't mind if future submitters have to break this again to keep within a byte count or whatever (or if anyone's already started based on this solution and doesn't want to change theirs too much), but there is one good reason I've done this - TIO's Objective-C compiler only supports Clang, so this'll be very useful if anyone wants to add that!

#38. C, 802 bytes # 1"16" 2//v(@#/;n4"14" #/3 auaaZ<>16/"<"6/b.q@")(22)S# ␉␉␉␉ #yy␉;36!@ # ␉ #=␉> #[#yy#yy0l0mx01k1k0l0ix0jx0h0h1d111P0eU0bx0b0o1d0b0e0e00x1d0i0fx0g0n0n11x0o0n0cx0c0o0f0c0gx0g0f0h0j0j0i0001k10mx0m0l11111100(^_) #<␉| print((eval("1\x2f2")and( 9 )or(13 ))-(0and 4)^1<<(65)>>(62))or'(\{(\{})(\{}[()])}\{}\{}\{})'#46(8+9+9+9+9+=!)#1|=/=1/24=x=9[<$+@+-@@@@=>+<@@@=>+<?#>+.--.]/ __DATA__=1#// #.\."12"*␉ """"#// =begin␉// # #*/␉ #define␉z sizeof 'c'-1?"38":"37" #include␉<stdio.h> int main() /*/ #()#\'*/{puts(z);;}/*'`` $'main'␉// #-3o4o#$$$ <>3N.<>␉// #xx #x%~~~+␉+~*ttt*.x #xx =end #// """#"#// #0]#echo 21#/(\[FAC,1<-#2FAC,1SUB#1<-#52FAC,1SUB#2<-#32FACLEGEREEX,1PLEASEGIVEUPPLEASE) ap #_~nJ|#o51\ #0␛dggi2␛␉|1|6$//''25 >>>#>27.say# =#print(17)#^_^_7LEintndus({})!<>+]////Z222999/3!@"26

Try them online!

Here is my slightly tweaked version of the Incident tokeniser, designed to be a bit less golfed but a bit more useful.

I have also tweaked the whitespace a little to change some other tokens to make some attempt at centring, to re-tokenise Tab Linefeed (by moving the tab at the end of the #include line to in the middle, thus making three tokens), and to de-tokenise the triple-space token by moving one space in the define line.

#38. C, 804 bytes # 1"16" 3//v(@#/;n4"14" #/3 auaaZ<>16/"<"6/b.q@")(22)S# ␉␉␉␉ #yy␉;36!@ # ␉ #=␉> #[#yy#yy0l0mx01k1k0l0ix0jx0h0h1d111P0eU0bx0b0o1d0b0e0e00x1d0i0fx0g0n0n11x0o0n0cx0c0o0f0c0gx0g0f0h0j0j0i0001k10mx0m0l11111100(^_) #<␉| print((eval("1\x2f2")and( 9 )or(13 ))-(0and 4)^1<<(65)>>(62))or'(\{(\{})(\{}[()])}\{}\{}\{})'#46(8+9+9+9+9+=!)#1|=/=1/24=x=9[<$+@+-@@@@=>+<@@@=>+<?#>+.--.]/ __DATA__=1#// #.\."12"*␉ """"#// =begin␉// # #*/␉ #define␉z sizeof 'c'-1?"38":"37" #include␉<stdio.h> int main() /*/ #()#\'*/{puts(z);;}/*'`` $'main'␉// #-3o4o#$$$ <>3N.<>␉// #xx #x%~~~+␉+~*ttt*.x #xx =end #// """#"#// #0]#echo 21#/(\[FAC,1<-#2FAC,1SUB#1<-#52FAC,1SUB#2<-#32FACLEGEREEX,1PLEASEGIVEUPPLEASE) ap #_~nJ|#o51\ #0␛dggi2␛␉|1|6$//''25 >>>#>27.say# =#print(17)#^_^_7LEintndus({})!<>+]////Z222999/(3!@)"26

Try them online!

Here is my slightly tweaked version of the Incident tokeniser, designed to be a bit less golfed but a bit more useful.

I have also tweaked the whitespace a little to change some other tokens to make some attempt at centring, to re-tokenise Tab Linefeed (by moving the tab at the end of the #include line to in the middle, thus making three tokens), and to de-tokenise the triple-space token by moving one space in the define line.

Finally, a day after initial submission, I decided to get to the bottom of the scary preprocessor warning that gcc produced (and which made Clang fail). I determined that the reason the first line worked at all is because it's the output from the preprocessor that provides debug info like original filenames and line numberings. They didn't like the first "2" on the first line, because this meant "returning from an included file into the given file", and obviously that's impossible given there haven't been any included files. After changing it to a "1" (start normal header) made a few too many languages choke, I changed it to a "3" (start internal component header), which broke only Hexagony, since it was now relying on the 2. So at the start of the Hexagony code I added an open bracket ( to decrement the 3 to a 2, then a close bracket ) after the end (@) of the hexagony code to satisfy Retina, Prelude and Underload which all expected matching brackets. Re-testing Reng and Modular SNUSP produced no issues, and the Incident tokens looked right, so I had now fixed it! I've tested it on a variety of exotic architectures and it appears to work. I know it's not important for a code golf, and I won't mind if future submitters have to break this again to keep within a byte count or whatever (or if anyone's already started based on this solution and doesn't want to change theirs too much), but there is one good reason I've done this - TIO's Objective-C compiler only supports Clang, so this'll be very useful if anyone wants to add that!

Incident Works!
Source Link
Muzer
  • 423
  • 3
  • 5

This program prints 38 in C, 37 in C++, 36 in Labyrinth, 35 in INTERCAL, 34 in Rail, No idea33 in Incident, 32 in Whirl, 31 in Modular SNUSP, 30 in Whitespace, 29 in Trigger, 28 in Brain-Flak, 27 in Perl 6, 26 in 05AB1E, 25 in Pip, 24 in Thutu, 23 in Hexagony, 22 in Underload, 21 in Nim, 20 in Prelude, 19 in Reng, 18 in Cardinal, 17 in Julia, 16 in Pyth, 15 in Haystack, 14 in Turtlèd, 13 in Ruby, 12 in Fission, 11 in Befunge-98, 10 in Befunge-93, 9 in Perl 5, 8 in Retina, 7 in Japt, 6 in SMBF, 5 in Python 2, 4 in ><>, 3 in Minkolang, 2 in V/Vim, and 1 in Python 3.

I've notnow tested Incident yet; I've no way of running it where I'm sat now. I'll have a better look at, and it this eveningworks! Many thanks to see if I can make head or tail of it@Chance and @LliwTelracs, but I thought I'd post what I had in the meantimewhich I've just realised is NOT a Welsh name, since everybody else seemsfor helping me get to have similar troublesgrips with Incident! However,it. See this syntax highlighting. I have now removed the ; token that was appearing before the #yy token. I did this by simply adding an extra ; after the gets statement (my previous attempt involved replacing s (which now appears much more in the C program than it did in the previous one) in the "detokenising" string with a ;, but it turned out I was actually a character short for Hexagony (thanks @Chance), so after attempts to add an extra character to this last line failed, I just changed it back and added the extra semicolon elsewhere).

Bear in mind I've never used most of these languages, I hope my success encourages more newcomers to give this a try! I just hope it's not a lost cause to make Incident work...

This program prints 38 in C, 37 in C++, 36 in Labyrinth, 35 in INTERCAL, 34 in Rail, No idea in Incident, 32 in Whirl, 31 in Modular SNUSP, 30 in Whitespace, 29 in Trigger, 28 in Brain-Flak, 27 in Perl 6, 26 in 05AB1E, 25 in Pip, 24 in Thutu, 23 in Hexagony, 22 in Underload, 21 in Nim, 20 in Prelude, 19 in Reng, 18 in Cardinal, 17 in Julia, 16 in Pyth, 15 in Haystack, 14 in Turtlèd, 13 in Ruby, 12 in Fission, 11 in Befunge-98, 10 in Befunge-93, 9 in Perl 5, 8 in Retina, 7 in Japt, 6 in SMBF, 5 in Python 2, 4 in ><>, 3 in Minkolang, 2 in V/Vim, and 1 in Python 3.

I've not tested Incident yet; I've no way of running it where I'm sat now. I'll have a better look at it this evening to see if I can make head or tail of it, but I thought I'd post what I had in the meantime, since everybody else seems to have similar troubles with Incident! However, I have now removed the ; token that was appearing before the #yy token. I did this by simply adding an extra ; after the gets statement (my previous attempt involved replacing s (which now appears much more in the C program than it did in the previous one) in the "detokenising" string with a ;, but it turned out I was actually a character short for Hexagony, so after attempts to add an extra character to this last line failed, I just changed it back and added the extra semicolon elsewhere).

Bear in mind I've never used most of these languages, I hope my success encourages more newcomers to give this a try! I just hope it's not a lost cause to make Incident work...

This program prints 38 in C, 37 in C++, 36 in Labyrinth, 35 in INTERCAL, 34 in Rail, 33 in Incident, 32 in Whirl, 31 in Modular SNUSP, 30 in Whitespace, 29 in Trigger, 28 in Brain-Flak, 27 in Perl 6, 26 in 05AB1E, 25 in Pip, 24 in Thutu, 23 in Hexagony, 22 in Underload, 21 in Nim, 20 in Prelude, 19 in Reng, 18 in Cardinal, 17 in Julia, 16 in Pyth, 15 in Haystack, 14 in Turtlèd, 13 in Ruby, 12 in Fission, 11 in Befunge-98, 10 in Befunge-93, 9 in Perl 5, 8 in Retina, 7 in Japt, 6 in SMBF, 5 in Python 2, 4 in ><>, 3 in Minkolang, 2 in V/Vim, and 1 in Python 3.

I've now tested Incident, and it works! Many thanks to @Chance and @LliwTelracs, which I've just realised is NOT a Welsh name, for helping me get to grips with it. See this syntax highlighting. I have removed the ; token that was appearing before the #yy token. I did this by simply adding an extra ; after the gets statement (my previous attempt involved replacing s (which now appears much more in the C program than it did in the previous one) in the "detokenising" string with a ;, but it turned out I was actually a character short for Hexagony (thanks @Chance), so after attempts to add an extra character to this last line failed, I just changed it back and added the extra semicolon elsewhere).

Bear in mind I've never used most of these languages, I hope my success encourages more newcomers to give this a try!

Fix Hexagony bug
Source Link
Muzer
  • 423
  • 3
  • 5
Loading
Add link to tokeniser
Source Link
Muzer
  • 423
  • 3
  • 5
Loading
Make some attempt at fixing Incident
Source Link
Muzer
  • 423
  • 3
  • 5
Loading
Extend and break up explanation.
Source Link
Muzer
  • 423
  • 3
  • 5
Loading
Add bit about implementing byte-saving changes suggested by Chance.
Source Link
Muzer
  • 423
  • 3
  • 5
Loading
char replaced with character constant.
Source Link
Muzer
  • 423
  • 3
  • 5
Loading
Source Link
Muzer
  • 423
  • 3
  • 5
Loading