56
\$\begingroup\$

Input must not be required, and output must read "All your base are belong to us".

Restrictions

  • No external resources.

    Plus a minimum of two of the following:

  • You cannot use "a", "b", "t", "u", or "y" in any case in your code (bonus -10 to your golf score if you can do this)

  • You cannot use "l", "o", "s", "e", or "r" in any case in your code (bonus -20 to your golf score if you can do this)

  • You cannot use "n", "g", "0", "1", or "2" in any case in your code (bonus -30 to your golf score if you can do this)

So for example, if you manage to get the code done with 40 characters and use rules 1 and 2, your golf score is 40 - 10 - 20 = 10 chars.

Smallest code golf score wins... Good luck!

\$\endgroup\$
20
  • 5
    \$\begingroup\$ So much as declaring a string breaks all three restrictions, and char, var and Write break two of them each. This is going to be tough to get valid answers, bar maybe Barinfuck. \$\endgroup\$ Commented Jan 23, 2014 at 2:28
  • 7
    \$\begingroup\$ "no input required". Doesn't that mean that I could, for example, do something like print(input()) (python)? The user would be required to input the correct string, but that isn't forbidden. \$\endgroup\$
    – Justin
    Commented Jan 23, 2014 at 6:40
  • 5
    \$\begingroup\$ @Quincunx I wouldn't accept such a solution, as the code is not guaranteed to output a correct solution. Also, stdin is arguably an "external source". \$\endgroup\$
    – nitro2k01
    Commented Jan 23, 2014 at 18:39
  • 2
    \$\begingroup\$ @PranavHosangadi There is a deleted answer to this question with a score of -6 which is essentially the same as that. It's been done before a number of times in various questions and is explicitly disallowed in the code-golf tag. \$\endgroup\$
    – Gareth
    Commented Jan 24, 2014 at 10:31
  • 1
    \$\begingroup\$ According to code-golf standard rules answers in latin1/unicode/name you charmap is rated in bytes after conversion to utf-8. Are we to count like that or have you chosen a different score method? Current leader would then be at 0 instead of -40. \$\endgroup\$
    – Sylwester
    Commented Jan 30, 2014 at 1:27

45 Answers 45

46
\$\begingroup\$

GolfScript, -22 (38 characters, -60 bonus)

"„¯¯c¼²¸µc¥¤¶¨c¤µ¨c¥¨¯²±ªc·²c¸¶"{67-}%
\$\endgroup\$
12
  • 4
    \$\begingroup\$ How does this work? \$\endgroup\$ Commented Jan 23, 2014 at 14:57
  • 39
    \$\begingroup\$ @RyanCarlson Magic. \$\endgroup\$
    – Howard
    Commented Jan 23, 2014 at 15:18
  • 4
    \$\begingroup\$ "..." defines a string and the block {}% performs a mapping operation over all characters. Inside the block the ascii value is available on the stack and 67- subtracts 67 from each ascii value. \$\endgroup\$
    – Howard
    Commented Jan 23, 2014 at 15:19
  • 4
    \$\begingroup\$ OK, case is probably the wrong word to use, but you know what I mean. I'm pretty sure superscript 2 is still a 2, so Rule 3 hasn't been met. \$\endgroup\$
    – Trent
    Commented Jan 24, 2014 at 5:48
  • 3
    \$\begingroup\$ @FizzBuzz I know what you're trying to say, but I think what matters is that 2 and ² are different glyphs with distinct codepoints. You can make the argument that, in a denotational sense, they are the same symbol, but I think that's a far more abstract interpretation than the question merits. \$\endgroup\$ Commented Jan 24, 2014 at 14:46
36
\$\begingroup\$

Sclipting, −40

뀖롬긇땯덗긠눦굳뉒걡댦넠눦녬닶멧긇끯긇녳
  • = 20 characters − 60 bonus
  • Only works if the input is empty, which I take to be the case; if not, add in front, changing the score to −39.
  • If I can assume the input to be what I want (as this answer apparently does), then the empty program is a solution and my score is −60.
\$\endgroup\$
2
  • \$\begingroup\$ Well, "input is not required" as I said, so I'd throw the 丟 in front and alter the score to -39, but great effort! Especially considering you invented the language, dude! \$\endgroup\$ Commented Jan 29, 2014 at 23:10
  • 1
    \$\begingroup\$ As a Korean seeing Korean syllables in code is amazing. \$\endgroup\$ Commented Apr 1, 2017 at 15:39
31
\$\begingroup\$

Brainfuck, 267 - 60 = 207

++++++++[>++++++++<-]>+.<+++++++[>++++++<-]>+..>>++++++[<+++++>-]<++.<+++++++++
++++.----------.++++++.---.>.<<++++[>----<-]>.-.<+++[>++++++<-]>.--------------
.>.<----.<++++[>++++<-]>+.-------------.>.<---.+++.+++++++.+++.-.-------.>.<+++
++++++++++.-----.>.<++++++.--.
\$\endgroup\$
3
  • \$\begingroup\$ Can that be reduced any further, I wonder? :) \$\endgroup\$ Commented Jan 29, 2014 at 23:00
  • 2
    \$\begingroup\$ fbonetti did better in his Brainfuck answer. \$\endgroup\$ Commented Jan 30, 2014 at 3:05
  • 2
    \$\begingroup\$ And FIQ did even better 4 days later \$\endgroup\$
    – schnaader
    Commented Dec 11, 2014 at 12:41
29
\$\begingroup\$

JavaScript - 140 bytes - 60 bonus = 80 points

(x="Ǎľľ y̌ǒǔř b̌ǎšě ǎřě b̌ěľǒňǧ ťǒ ǔš")[x[3*9]+x[34]+"p"+x[4]+x[5*5]+"c"+x[34]]("̌","",x[6*7])

Run in Firefox.

I know what you're thinking. No, those aren't the characters that are listed in the question. Those are characters with a caron, or háček (picked randomly from a list of diacritics). Even though they're combining marks, they aren't two separate characters.

\$\endgroup\$
1
  • \$\begingroup\$ Node.js REPL: String.fromCharCode(65,108,108,32,121,111,117,114,32,98,97,115,101,32,97,114,101,32,98,101,108,111,110,103,32,116,111,32,117,115); \$\endgroup\$ Commented May 4, 2018 at 8:00
28
\$\begingroup\$

APL (43 - 30 - 20 = -7)

⎕AV['⊥┤┤ ø┼&┐ `∣┘û ∣┐û `û┤┼─ù ´┼ &┘'⍳⍨⌽⎕AV]

This satisfies rules 2 and 3.

\$\endgroup\$
5
  • \$\begingroup\$ This is going to be hard to beat! \$\endgroup\$ Commented Jan 23, 2014 at 3:33
  • 1
    \$\begingroup\$ does this return the result or print it? \$\endgroup\$ Commented Jan 23, 2014 at 4:10
  • \$\begingroup\$ @AaronDavies: both, the result is automatically printed \$\endgroup\$
    – marinus
    Commented Jan 23, 2014 at 19:37
  • \$\begingroup\$ @marinus I tried this in TryAPL.com and got an INVALID TOKEN error.... perhaps from the initial and tailing character before AV... Is there any other place I can test this...? \$\endgroup\$ Commented Jan 29, 2014 at 23:02
  • \$\begingroup\$ @WallyWest: use Dyalog APL (dyalog.com). Get the unregistered version, it's free. TryAPL is so limited it's nearly useless. \$\endgroup\$
    – marinus
    Commented Jan 30, 2014 at 17:23
22
\$\begingroup\$

HTML/CSS 70

<p style="transform:rotate(.5turn)">sn oʇ ƃuoləq əɹɐ əsɐq ɹnoʎ llɐ</p>

http://jsbin.com/EjekuvuF/1/

I thought I was being clever with the upside down type but then realized I couldn't meet any of the ancillary rules with the actual HTML/CSS. Oh well.

UPDATE:

User Flame suggested a more cross-browser compliant solution:

<p style="transform:rotate(180deg)">sn oʇ ƃuoləq əɹɐ əsɐq ɹnoʎ llɐ</p>  
       

http://jsbin.com/EjekuvuF/6

\$\endgroup\$
5
  • \$\begingroup\$ I guess you can use XML character references to salvage the situation. \$\endgroup\$
    – MvG
    Commented Jan 24, 2014 at 9:51
  • 3
    \$\begingroup\$ I like the idea behind the solution though. \$\endgroup\$
    – Sumurai8
    Commented Jan 25, 2014 at 10:39
  • \$\begingroup\$ I'll give props to it too... thought for some reason transform:rotate(.5turn) resolves to a Syntax error... I like the imagination put into this... \$\endgroup\$ Commented Jan 29, 2014 at 23:12
  • \$\begingroup\$ @WallyWest I didn't test in all browsers. I bet that might be browser-specific rather than the official W3C syntax. (Does work in Chrome, though) \$\endgroup\$
    – DA.
    Commented Jan 29, 2014 at 23:33
  • 4
    \$\begingroup\$ You should use ∀ instead of ɐ :) \$\endgroup\$
    – Timwi
    Commented Feb 6, 2014 at 13:39
12
\$\begingroup\$

MATLAB, All bonuses: Score of -20 (40-60)

['' '¤ÏÏèÜÒØÕèÅÄÖÈèÄÕÈèÅÈÏÒÑÊè×ÒèØÖ'-99]

EDIT:

Note that I am not sure of what the system requirements are to run this, tested on windows. For those struggeling to copy, a similar code can be generated like so:

char('All your base are belong to us' + 99)

If it would have been allowed to ask anything as input, a solution with less characters (but also missing the bonus) would of course be possible.

input('')
\$\endgroup\$
8
  • \$\begingroup\$ Please explain how you plan to output anything using only input. The second answer is (afaik) just not true. \$\endgroup\$
    – DJSpud
    Commented Jan 23, 2014 at 19:01
  • 2
    \$\begingroup\$ @Jhawins: MATLAB outputs the result of each expression that doesn't end in a semicolon. The input('') call doesn't end in a semicolon, hence it will generate output. \$\endgroup\$
    – Ben Voigt
    Commented Jan 23, 2014 at 19:07
  • 6
    \$\begingroup\$ If that's correct, then my JS answer is "prompt()" \$\endgroup\$
    – DJSpud
    Commented Jan 23, 2014 at 19:08
  • \$\begingroup\$ And shell would be dd, but perhaps that counts as an external resource. So would user input, of course. \$\endgroup\$
    – gerrit
    Commented Jan 23, 2014 at 20:19
  • \$\begingroup\$ I tried running this and got the following: _A,,E9/52E"!3%E!2%E"%,/.'E4/E5`3 I can understand the first answer, but the second answer requires input, which I said was not "required" \$\endgroup\$ Commented Jan 29, 2014 at 23:16
11
\$\begingroup\$

dc, 97 - 60 = 37 91 - 60 = 31 88 - 60 = 28 81 - 60 = 21

3C87596P4d^8/P7958389P7479394P6386533P7C89P749698CP644848CP459 8^699 7^3849736388974773333 86-++P

Improved version (the main idea here is to vary the input base, to increase the chances of finding a useful big number with no problematic digits):

IDi67793554D647F84C836645D6569F69Pi6385C77P9i35PDdi6^I9^+6D59CD83D664D34+P8CPFi98CCF5PCi97P

In base 7, the whole thing can become a single number! Lower bases are naturally less compact, but the lack of fix-up operations here makes up for it.

7i4398873968644388737548444897643735447698675366869556798538985674336396359936458859886P

My first solution used base 10. My second used a mix of base 9, 10, 12, 13, and 15. This one is in base 7. I truly feel like all the base are belong to me.

Last one, seriously: Base 13 does a great job on the first segment, then base 7 for the rest.

Di67793554D647F84C836645D6569F69P7i798789699638355733695878558396339387963789536P
\$\endgroup\$
1
  • \$\begingroup\$ So in other words, all your base 7 are belong to you, @Wumpus? \$\endgroup\$ Commented Jul 15, 2015 at 15:03
10
\$\begingroup\$

k (-7 = 53 - 60)

(#`)"c"$(465%3)-6h$"Z//{\",&){9:(6{:)6{96/,-4{',{&(";

doesn't include trailing newline, can be added at cost of one additional char:

(-#`)"c"$(465%3)-6h$"Z//{\",&){9:(6{:)6{96/,-4{',{&(";

annoyingly, the only offsets that work for this trick are 154 and 155

edit:

if it's sufficient to display the string (rather than printing it), as i suspect the APL solution does (it doesn't work in http://tryapl.com/, so i can't test it properly), it's

  "c"$(465%3)-6h$"Z//{\",&){9:(6{:)6{96/,-4{',{&("
"All your base are belong to us"

which is -12 = 48 - 60. can i get a ruling on whether this is sufficient?

\$\endgroup\$
1
  • \$\begingroup\$ I never asked for a trailing newline... :) \$\endgroup\$ Commented Jan 29, 2014 at 23:16
10
\$\begingroup\$

Python REPL, 122 116 98 characters - 30 bonus = 92 86 68 points

>>> '\x41\x6c\x6c \x79\x6f\x75\x72 \x62\x61\x73\x65 \x61\x72\x65 \x62\x65\x6c\x6fng \x74\x6f \x75\x73'

'All your base are belong to us'

I could get rid of the zeroes in Python 3.3 by replacing '\40' with \N{SP}, but alas, the N is not permitted.

Edit: Inspired by this answer, I've shortened it further by replacing \x40 by . Moreover, since I already use the 1, replacing \156 by n and \x67 by g shortens it by another 6 characters while incurring no extra penalty.

\$\endgroup\$
12
  • 1
    \$\begingroup\$ I wonder if this is this a valid entry, because it only works the interactive shell. If you put this in a .py file and execute it, there is no output. \$\endgroup\$ Commented Jan 23, 2014 at 13:00
  • 1
    \$\begingroup\$ It depends... I believe there is no general rule. Some questions allow interactive mode, others don't. \$\endgroup\$
    – Bakuriu
    Commented Jan 23, 2014 at 13:05
  • 1
    \$\begingroup\$ I've posted the question on meta. \$\endgroup\$
    – gerrit
    Commented Jan 23, 2014 at 13:15
  • 1
    \$\begingroup\$ This works in R too \$\endgroup\$
    – Zach
    Commented Jan 23, 2014 at 18:22
  • 1
    \$\begingroup\$ @AaronHall And after my edit, I brought mine down to 68! \$\endgroup\$
    – gerrit
    Commented Jan 26, 2014 at 15:24
9
\$\begingroup\$

Brainfuck, 205 203 - 60 = 145 143 bytes

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

Readable version:

++++[->++++<]>[->++++>++>+++++++>++++++>++++++++<<<<<]
64 32 112 96 128

>+.>>----..<.                     All                 65 108 108  32
>>>-------.<<+++.>>----.---.<<<.  your           121 111 117 114  32
>>++.-.>+.<++++.<<.               base            98  97 115 101  32
>>----.>-.<++++.<<.               are                 97 114 101  32
>>---.+++.<---.>>---.-.<<-----.<. belong  98 101 108 111 110 103  32
>>>++++++.-----.<<<.              to                     116 111  32
>>>++++++.--.                     us                     117 115
\$\endgroup\$
2
  • \$\begingroup\$ Good effort! \$\endgroup\$
    – Timwi
    Commented Feb 6, 2014 at 13:38
  • \$\begingroup\$ I kinda half-expected a Brainfuck solution eventually... Nice work! \$\endgroup\$ Commented Sep 10, 2014 at 23:37
7
\$\begingroup\$

Befunge 98 : 122 - 60 = 62

5f8+*:53-+:' \6-:5+' 91+:*3+::7+\8+:3-:7-:3-:' \3+::3-4+',' -+\4-:' \:4+\6+c+:f3+-:4+3-' '&3*:3+:6-:f+5-:' \d-:' '!+ff+k,@

Computes the ascii values, then prints them. I still need to try out other methods of forming the numbers to see if there are shorter ways.

\$\endgroup\$
1
  • \$\begingroup\$ I was wondering when you were gonna put your 2 bytes in... Nice work! \$\endgroup\$ Commented Jan 29, 2014 at 23:20
7
\$\begingroup\$

Python, 195-40 = 155

x,w,y,z,v=4*8,55,56,57,58;exec(("%c"*38)%(y+y,z+z,49+y,w+w,v+v,39-7,34,65,54+54,54+54,x,v+63,48+63,48+69,z+z,x,98,97,59+y,45+y,x,97,z+z,45+y,x,98,45+y,54+54,w+y,w+w,45+v,x,v+v,w+y,x,v+59,z+v,34))
\$\endgroup\$
6
\$\begingroup\$

SOGL V0.12, 15 - 60 = -45

šz█P'zUS½█│β3‘⁾

Try it Here!

šz█P'zUS½█│β3‘ is a compressed string of all your base are belong to us, but because that exact string compressed contained 0, it's split into 3 parts: all your base are, , belong to us (which cost one byte but gave a -30 byte bonus). The first and last strings are compressed with SOGLs English dictionary, and implicitly joined with spaces. The remaining is a simple sentence case built-in.
Note that SOGL postdates this challenge, but that's allowed now.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ I just have to ask... How??? Are we dealing with some clever compression technique here? I know nothing about SOGL... \$\endgroup\$ Commented Oct 6, 2017 at 23:51
6
\$\begingroup\$

Ruby, 121 - 50 = 71

A bit brute force, but most of the cute methods are ruled out:

$><<[65,c=36*3,c,d=8*4,363/3,f=c+3,c+9,c+6,d,x=98,97,j=c+7,k=3+x,d,97,c+6,k,d,x,k,c,f,j-5,5+x,d,c+8,f,d,c+9,j].pack('C*')

Breaks rule #1 because of the A in pack, the other two should be OK.

\$\endgroup\$
4
  • \$\begingroup\$ I can save 6 chars if we're just returning the result rather than printing it, I wasn't clear on that after looking at the other answers. \$\endgroup\$ Commented Jan 23, 2014 at 4:07
  • 1
    \$\begingroup\$ Extremely long, but no more “a”: pastebin.com/wnsvcAMh \$\endgroup\$
    – manatwork
    Commented Jan 23, 2014 at 10:39
  • \$\begingroup\$ @manatwork I love it! Somehow I never thought of that, even though I'm using << in my answer. \$\endgroup\$ Commented Jan 23, 2014 at 21:59
  • \$\begingroup\$ So you either use the 154 character solution @manatwork has used and claim the 60 point discount which gives you 94, or stick with the non-Rule 1 version and go with the 71... I know which I'd use :) \$\endgroup\$ Commented Jan 29, 2014 at 23:19
6
\$\begingroup\$

{ba,z}sh, 67 - 40  72 - 60 61 - 40 = 21

$'\x74r' K-~\#-\; _@-~\^-j<<<'Mxx ){%~ 3m#q m~q 3qx{z8 ${ %#'

Darn it, turns out I had a r in there that I hadn't noticed, so the 20 bonus doesn't apply!

\$\endgroup\$
10
  • 1
    \$\begingroup\$ In the zsh and bash versions I have handy, $'\x74\x72' can be used directly as a command name, saving you 8 characters for the $(m4<<<). Doesn't it work that way for you? \$\endgroup\$
    – user15244
    Commented Jan 24, 2014 at 14:50
  • \$\begingroup\$ And after looking at it again... using \x72 as a replacement for r gets you the 20 point bonus at the cost of losing the 30 point bonus (for the 2) \$\endgroup\$
    – user15244
    Commented Jan 24, 2014 at 15:10
  • \$\begingroup\$ @WumpusQ.Wumbley oh, you're right on both accounts. I didn't think of the 2 used there, let me see if I can find a way to get rid of it and avoid losing any bonuses. \$\endgroup\$
    – FireFly
    Commented Jan 24, 2014 at 15:33
  • \$\begingroup\$ Holy sh#t, that was ingenious! This looks like a Reverse ROT12 ASCII cypher... (am I right?) nicely done! \$\endgroup\$ Commented Jan 29, 2014 at 23:29
  • \$\begingroup\$ Nice answer. But does tr count as an external resource? \$\endgroup\$ Commented Jan 29, 2014 at 23:59
6
\$\begingroup\$

C, 75 bytes - 60 = 15

Thanks to @gastropner for getting the score down from 50 to 33 and from 19 to 15!

*q,i;f(p){(*(q=p)="\v&&j3%?8j(+9/j+8/j(/&%$-j>%j?9J"[i++]^74)?i=!f(++p):i;}

Takes the address of a char array as input and writes the string to the array.

Try it online!

Call with:

int main()
{
    char s[128];
    f(s);
    puts(s);
}

Output:

Old version (90 bytes - 40 = 50):

*q,i,j;f(p){for(i=3-3;j="Epp$}s v$fewi$evi$fipsrk$xs$ w"[i++];*q=j!=35-3?j-4:353/3)q=p++;}
\$\endgroup\$
8
  • 1
    \$\begingroup\$ Riffing on this, using the powers of XOR and recursion, you can reach 93 - 60 = 33 bytes: *q,i,j;x(p){if(j="\v&&j3%?8j(+9/j+8/j(/&%$-j>%j?9"[i++])*(q=p)=j^74,x(++p);}f(p){i=3-3;x(p);} \$\endgroup\$
    – gastropner
    Commented Jan 14, 2018 at 14:07
  • \$\begingroup\$ @gastropner Thanks! \$\endgroup\$
    – Steadybox
    Commented Jan 14, 2018 at 14:36
  • \$\begingroup\$ Could go with i=i<30 for another 2 bytes off. \$\endgroup\$
    – gastropner
    Commented Jan 14, 2018 at 15:51
  • \$\begingroup\$ @gastropner Can't use 0. \$\endgroup\$
    – Steadybox
    Commented Jan 14, 2018 at 15:51
  • \$\begingroup\$ Ah, yes, of course! \$\endgroup\$
    – gastropner
    Commented Jan 14, 2018 at 16:00
5
\$\begingroup\$

Brainfuck, (227 - 60 = 167)

+++++ +++++[>+++>++++++>+++++++++>++++++++++<<<<-]>>+++++.>>++++++++..<<<++.>>>+++++++++++++.----------.++++++.---.<<<.>>++++++++.-.>+.<++++.<<.>>----.>-.<++++.<<.>>---.+++.>------.+++.-.<++.<<.>>>++++++.-----.<<<.>>>++++++.--.
\$\endgroup\$
1
  • 2
    \$\begingroup\$ I dont think the space at the start, +++++ +++++ is needed? It could be 226 bytes. \$\endgroup\$
    – FinW
    Commented Feb 18, 2017 at 11:07
4
\$\begingroup\$

Postscript, 364 - 40 = 324

I couldn't do it without loser, of course. :)

/${cvx exec}def
/+{<3C7E4F6F597E3E>$ $}def
/*{<~P&(~>$}def
/-{( )<3C7E4F754E7E3E>$ $ 3 4<~P#;~>$ 4 3<~P)#3FP'-~>$}def
/_{36(      )<~OoP~><3C7E4F754E7E3E>$ $ 4 3<~P,S~>$ 48<~P'?~>$
${96 3<~P#;~>$ + -}<~P">~>$}def
/.{_ 96 3<~P#;~>$ -}def
65 - 777 .
895 353 + _ 774 333 + .
74933 333 + 7 * 3 + 333 + .
9593 4353 + .
689653949 335 + .
735 333 + .
775 333 + _ 5 5 + -

This starts with encoding the text as base-36 strings:

%-=Encoding strings as base-36 numbers=-
%All your base are belong to us
% handle uppercase A separately
%36#ll = %777
%36#your = %1618515
%36#yo = 36#ur = 36#base = 36#are = 36#belong = 36#to = 36#us =
%1248 1107 527198 13946 689654284 1068 1108

And then removing the 1s and 0s and 2s arithmetically. The strings can then be regenerated with 36 <string-buf> cvrs, but this yields upper-case letters, so we then need to iterate through and add 0x20 to make them lowercase.

The operators cvx exec allow us to execute string fragments of binary-encoded operator tokens in various encodings. Simplest is to encode an operator in hex <92??> but there's a 2 in there! So the "first-level" encoding is ascii85. Then any strings that still contained forbidden characters went through extra levels of hex -> ascii85 -> hex -> ascii85.

\$\endgroup\$
4
\$\begingroup\$

JavaScript

(306 characters - 60 bonus = 246) (206 characters - 50 bonus = 156)

(123 chars = 173 chars - 50 bonus)

Kind of nooby, probably could get more off... Let me know if I've stuffed something up, this alerts "All your base are belong to us". This is also ASCII-only.

(c=(''+!'')[4-3],x=([][3]+c)[6])[a='c\x6F'+x+'\x73t'+c+'uct\x6F'+c][a]('a\x6C\x65'+c+'t("A\x6C\x6C y\x6Fu'+c+' ba\x73\x65 a'+c+'\x65 b\x65\x6C\x6F'+x+'\x67 t\x6F u\x73")')()

If you count the console itself as output, this would also count (57 with bonus):

'A\x6C\x6C y\x6Fu'+(c=(''+!'')[4-3])+' ba\x73\x65 a'+c+'\x65 b\x65\x6C\x6F'+([][3]+c)[6]+'\x67 t\x6F u\x73'
\$\endgroup\$
8
  • \$\begingroup\$ Great approach, though a few letter subsitutions could have also allowed you the Rule-1 bonus as well... Good work. \$\endgroup\$ Commented Jan 29, 2014 at 23:34
  • \$\begingroup\$ @WallyWest: Thanks! The problem in JavaScript is that it's rather hard to get an "A" without breaking the other rules or using up way too many characters -- it would take up more than 10 characters alone. \$\endgroup\$ Commented Jan 29, 2014 at 23:43
  • \$\begingroup\$ True, you have to outweight the additional letters against the bonuses... Nice work though! \$\endgroup\$ Commented Jan 29, 2014 at 23:44
  • \$\begingroup\$ x=(c.t+c)[6] is a bit shorter \$\endgroup\$ Commented Apr 13, 2016 at 17:04
  • 1
    \$\begingroup\$ ...which is letter_a=(+{}+c)[1] and letter_A=([][a]+c)[9] \$\endgroup\$ Commented Apr 13, 2016 at 17:20
4
\$\begingroup\$

Jelly, 23 - 60 = -37

“%⁼“¡¢8ṣƤ¹;“pȷȦÆ⁾“¡PȤṫ»

Try it online!

This is just the compressed representation of ["All", " your base are", " belong to", " us"] (Jelly has a compressed string format). The string's split into multiple pieces in order to ensure that none of the banned characters appear within the compressed representation; they're all implicitly concatenated at the end of the program.

\$\endgroup\$
3
\$\begingroup\$

Brainfuck, 306 - 60 = 246

----[---->+<]>++.[--->+<]>+..[++>---<]>--.--[->++++<]>+.----------.++++++.---.[-->+++++<]>+++.[--->+<]>++.-.--[--->+<]>--.++++[->+++<]>.--[--->+<]>-.[--->+<]>+.--[--->+<]>---.-------------.--[--->+<]>-.[--->+<]>++.+++.+++++++.+++.-.-------.-[--->+<]>--.---[->++++<]>.-----.[--->+<]>-----.---[->++++<]>+.--.
\$\endgroup\$
4
  • \$\begingroup\$ Surely this could be reduced somehow? \$\endgroup\$ Commented Jul 15, 2015 at 14:09
  • \$\begingroup\$ @WallyWest I don't have the time to reduce a program like this by 5% for no reason :P feel free to post improvements, though! \$\endgroup\$
    – Timtech
    Commented Jul 16, 2015 at 3:48
  • \$\begingroup\$ No obligation needed here :) \$\endgroup\$ Commented Jul 16, 2015 at 6:48
  • \$\begingroup\$ @WallyWest You're right about shortening it though. It could use some major improvements. \$\endgroup\$
    – Timtech
    Commented Jul 17, 2015 at 11:22
3
\$\begingroup\$

PHP (35 - 60 = -25 bytes)

HOW LOW CAN YOU GET ?[1][2]

$ xxd yourbase.php 
0000000: 3c3f 3d7e be93 93df 8690 8a8d df9d 9e8c  <?=~............
0000010: 9adf 9e8d 9adf 9d9a 9390 9198 df8b 90df  ................
0000020: 8a8c 3b                                  ..;

[1] This program can be decoded using xxd -r.
[2] Yeah, heavy solution reuse here. I think it's... third problem I solved this way. Perhaps I should move to something else, but it's not that this is not great for problems that forbid you from using most characters.

\$\endgroup\$
2
  • \$\begingroup\$ I don't get it, what are you trying to do here? \$\endgroup\$ Commented Jan 29, 2014 at 23:34
  • \$\begingroup\$ @WallyWest He bit-inverted the string; resulting in 31 extended ASCII chars, which PHP tries to interprete as a constant name and because it finds no such constant interpretes as a string. This string gets negated back with ~. \$\endgroup\$
    – Titus
    Commented Apr 18, 2017 at 16:21
3
\$\begingroup\$

Bash, 52 - 10 - 30 = 12

The following is to be executed in a (still pretty common) ISO-8859-1 environment:

$'\x74r' À-þ  @-~<<<'Áìì ùïõò âáóå áòå âåìïîç ôï õó'

This calls tr, which translates the characters in a suitable way. I had to either use the r and violate rule 2, or use a digit in the escape and violate rule 3. Since 3 gives more bonus, I chose the former.

\$\endgroup\$
10
  • 1
    \$\begingroup\$ Yes he did :) You cannot use "a", "b", "t", "u", or "y" in any case Also you need minimum two of the conditions \$\endgroup\$
    – cowls
    Commented Jan 24, 2014 at 9:24
  • \$\begingroup\$ @cowls: Seems I completely missed that point, thanks for making it clear. Rewrote my answer to comply with that. \$\endgroup\$
    – MvG
    Commented Jan 24, 2014 at 9:49
  • \$\begingroup\$ @MvG great re-work... Well done! \$\endgroup\$ Commented Jan 29, 2014 at 23:36
  • \$\begingroup\$ Does tr constitute an external resource? \$\endgroup\$ Commented Jan 30, 2014 at 0:02
  • \$\begingroup\$ @DigitalTrauma: More like a standard library, I'd say, although this is sure subject to interpretation. But it's specified in the POSIX standard, so I guess any POSIX system has to have it, so it's part of the system. \$\endgroup\$
    – MvG
    Commented Jan 30, 2014 at 6:50
3
\$\begingroup\$

Pure Bash (no external resources), 141 chars - 50 bonus = 91

Z=({k..v})
f=$'\x65'
h=$'\x6c'
i=$'\x6f'
j=${Z[7]}
k=$'\x73'
m=$'\x75'
$f$'\x63'h$i A$h$h y$i$m$j ba$k$f a$j$f b$f$h$i${Z[3]}$'\x67' t$i u$k

Intentionally dropping the 10-point bonus to get a better overall score.

This works on any bash version 3.00.15 or later that I have tried.

How does it work

There's no rocket science here - just bash expansions of one form or another:

  • Simple hex expansion to obtain required character. This works for characters whose hex representation doesn't contain [012]. e.g. $'\x65' gives us e
  • For other characters, we generate a bash array of sequential characters using brace expansion into an array initialization (Z=({k..v})). The start of the brace expansion is chosen carefully so that the indexes of the characters we require don't contain [012]. e.g. ${Z[7]} gives us r.
  • bash is flexible enough to allow its commands to be constructed from the contents of multiple strings. So $f$'\x63'h$i expands to echo.
  • For characters that are required only once, the expansion is inserted inline to the echo command string.
  • For characters that are required twice or more it is more efficient to expand them to variables, then reference the variables.

Previous answer with full bonus, but worse overall score:

Pure Bash (no external resources), 193 chars - 60 bonus = 133

I know this won't win, but I wanted to prove to myself this is possible in bash, while satisfying all requirements:

Z=({3..8} {C..z})
c=${Z[36]}
d=${Z[37]}
f=$'\x65'
h=$'\x6c'
i=$'\x6f'
j=${Z[53]}
k=$'\x73'
m=$'\x75'
$f$'\x63'h$i ${c^}$h$h $'\x79'$i$m$j $d$c$k$f $c$j$f $d$f$h$i${Z[49]}$'\x67' $'\x74'$i $m$k

This does require a fairly recent version of bash for the ${c^} parameter expansion. 4.2.25 is fine, but 3.2.48 is a no-go.

\$\endgroup\$
2
  • \$\begingroup\$ I take my hat off to you... I just executed this... nice work... Very nice work. \$\endgroup\$ Commented Jan 29, 2014 at 23:39
  • \$\begingroup\$ @WallyWest - I just edited in a shorter version. \$\endgroup\$ Commented Jan 30, 2014 at 1:19
2
\$\begingroup\$

PHP, 186 - 10 - 30 = 146

I had to get a little creative ;)

 <?=chr(65).'ll '.chr(88+33).'o'.chr(39*3).'r '.chr(98).chr(97).'s'.chr(68+33).' '.chr(97).chr(38*3).chr(68+33).' '.chr(98).'elo'.chr(77+33).chr(69+34).' '.chr(83+33).'o '.chr(39*3).'s'?>
\$\endgroup\$
3
  • \$\begingroup\$ you could still golf it a little and mantain the answer idea: echo doesn't require parentheses(1), you can use <?= instead of echo(4), you can save the repeated letters in variables ('l', ' '). use 54*2 instead of 54+54 \$\endgroup\$
    – Einacio
    Commented Jan 24, 2014 at 15:31
  • 1
    \$\begingroup\$ Fixed. I could only do multiplying on certain ones. I can't do 54*2 because that it has a 2 in it, so I could only do it with ones that had 3 or higher has a factor. If I use a decimal, then there's no less characters. \$\endgroup\$ Commented Jan 24, 2014 at 17:26
  • \$\begingroup\$ a few golfing tips taking 50 bytes off. Most of it (23+9 bytes): You can replace the remaining chr(68+33) and chr(38*3) with literal e and r. \$\endgroup\$
    – Titus
    Commented Apr 18, 2017 at 16:56
2
\$\begingroup\$

PHP, 67 bytes -60 bonus = 7

<?=d__cJZFFcQWFVcWFVcQV_ZZQcCZcFF^"%33C3534C3653C643C333546C75C35";

bitwise XOR on the ASCII characters

I brute forced a pair of characters not in the forbidden characters for each character in output.
No word character pair for A and I don´t like extended ASCII, so I live with one string in quotes.

\$\endgroup\$
3
  • \$\begingroup\$ Now, @Titus, how exactly does this work? I can only guess that somehow you're using some clever replace function... I've never seen this kind of witchcraft with PHP before... All I know is that it works! \$\endgroup\$ Commented Apr 19, 2017 at 8:33
  • \$\begingroup\$ @WallyWest I´ll explain inline. \$\endgroup\$
    – Titus
    Commented Apr 19, 2017 at 8:47
  • \$\begingroup\$ The ^ symbol! Of course! I had read about PHP's XOR ability a while back but had completely forgotten about it... Nice one! \$\endgroup\$ Commented Apr 19, 2017 at 8:49
2
\$\begingroup\$

Pxem, Filename: 45 bytes + Content: 0 bytes - Bonus: 30 bytes = 15 bytes.

  • Filename (escaped some characters): Xx\202\330\330\100\362\336\352\344\100\304\302\346\312\100\302\344\312\100\304\312\330\336\334\316\100\350\336\100\352\346!.z\002.$.o.c!.a
    • Printed version: Xx‚ØØ@òÞêä@ÄÂæÊ@ÂäÊ@ÄÊØÞÜÎ@èÞ@êæ!.z.$.o.c!.a
  • Content: empty

What it does

  • Twice necesity ASCII codes before.
  • Halve on this program.

Try it online!


Pxem, Filename: 55 bytes + Content: 0 bytes - Bonus: 50 bytes = 5 bytes.

  • Filename (escaped some): Xx\202\330\330\100\362\336\352\344\100\304\302\346\312\100\302\344\312\100\304\312\330\336\334\316\100\350\336\100\352\346!.z\002.$.t.v.m.v.c!.a.t.p
    • Printed: XxØØ@òÞêä@ÄÂæÊ@ÂäÊ@ÄÊØÞÜÎ@èÞ@êæ!.z.$.t.v.m.v.c!.a.t.p
  • Content: empty

What it does

  • Move to bottom each of them.
  • Hide last ! to heap.
  • Print all of them at once.

Try it online!

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

Vyxal , 20 bytes, score -40

‛λʀ«×∇⟇Ȧߥfė₀⌊↓qεǏq⟑

Try it Online!

-4 bytes / -4 score thanks to Aaron Miller.

\$\endgroup\$
5
  • 1
    \$\begingroup\$ You’ve used an S in your code, the -20 bonus is invalid… \$\endgroup\$ Commented May 25, 2021 at 21:07
  • \$\begingroup\$ @EliseoD'Annunzio It specified lowercase s - 's', not capital. \$\endgroup\$
    – emanresu A
    Commented May 26, 2021 at 4:17
  • \$\begingroup\$ Actually what I wrote in my initial brief was 'You cannot use "l", "o", "s", "e", or "r" in any case in your code (bonus -20 to your golf score if you can do this)' Emphasis on "ANY case" as in upper or lower case... \$\endgroup\$ Commented May 26, 2021 at 4:23
  • \$\begingroup\$ @EliseoD'Annunzio Oh, reverting to the 23-byter. Give me a moment. \$\endgroup\$
    – emanresu A
    Commented May 26, 2021 at 4:24
  • \$\begingroup\$ 20 bytes, -40 score \$\endgroup\$ Commented Aug 4, 2021 at 16:54
1
\$\begingroup\$

Python, 181 - 40 = 141

[I'm using version 2.7.2 YMMV - the builtin, file is gone in python 3.X]

f=file.__doc__;c=5-3;l=f[c];s=' ';e=f[3];h=f[6+7];i=f[c*87];j=3**3;f[j*c*5]+l+l+s+f[-57]+h+f[j-7]+f[j-3]+s+f[j-8]+f[6]+i+e+s+f[6]+f[j-3]+e+s+f[j-8]+e+l+h+f[5]+f[j]+s+f[45]+h+s+f[j-7]+i
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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