30
\$\begingroup\$

In exactly 1024 characters, no more, no less:

  • Must print Hello World.
  • Must not use unnecessary whitespace.
  • Must not use comments.

Judging should favor creativity and/or humor over simple obfuscation when voting up answers.


The earliest I will select an answer is the 11th (Sunday) of November (2012). I'm seeing some awesome entries so far, can't wait to see what else people come up with.

\$\endgroup\$
13
  • \$\begingroup\$ What about unnecessary comments? \$\endgroup\$
    – Strigoides
    Commented Oct 31, 2012 at 22:11
  • 1
    \$\begingroup\$ Welcome to CodeGolf.SE! Code-bowling is usually about getting the largest character count, but you've set a target of 1024, which more than one answer has already hit. Given that, what's the objective winning criterion? \$\endgroup\$
    – Gareth
    Commented Nov 1, 2012 at 9:08
  • 1
    \$\begingroup\$ The problem with 'highest upvotes' or 'most creative' as winning criteria is that no-one really knows what will garner up-votes or what you personally will find creative. Unfortunately, I can't think of an objective winning criteria other than 'first to post' which would discourage further answers. As to the tag - I suppose if we're aiming to get as close as possible to a fixed target we could have [code-boules] or [code-curling] :-) \$\endgroup\$
    – Gareth
    Commented Nov 1, 2012 at 12:40
  • 9
    \$\begingroup\$ As soon as I get another 20 Rep points here, I'll change it to code-curling. I like that! \$\endgroup\$ Commented Nov 1, 2012 at 12:51
  • 2
    \$\begingroup\$ The answers on this question have a ridiculous number of upvotes. I say we reopen. I suggested code-shuffleboard on meta quite a while ago, and this gives a good example of the creativity that can go into solutions for that type of challenge. \$\endgroup\$
    – boothby
    Commented Dec 4, 2013 at 7:46

12 Answers 12

50
\$\begingroup\$

C# (and without “Hello World” anywhere)

Code-golfed, so that obviously no unnecessary whitespace is used:

using System;using System.IO.Compression;using System.Runtime.Serialization;using System.Runtime.Serialization.Json;using System.Linq;using System.Net;using System.Text.RegularExpressions;class C{static void Main(){var g=WebRequest.Create("https://api.stackexchange.com/2.1/questions/8859?site=codegolf&filter=withbody");var r=(HttpWebResponse)g.GetResponse();if(r.StatusCode==HttpStatusCode.OK){var s=r.GetResponseStream();foreach(var a in r.ContentEncoding.ToLowerInvariant().Split(',').Reverse())switch(a){case"gzip":s=new GZipStream(s,CompressionMode.Decompress);break;case"deflate":s=new DeflateStream(s,CompressionMode.Decompress);break;default:throw new InvalidOperationException();}var d=new DataContractJsonSerializer(typeof(R));var q=(R)d.ReadObject(s);var e=new Regex("<code>([^<]*)</code>");var m=e.Match(q.I[0].B);Console.WriteLine(m.Groups[1].Value);}}}[DataContract]public class R{[DataMember(Name="items")]public I[]I{get;set;}}[DataContract]public class I{[DataMember(Name="body")]public string B{get;set;}}

Formatted for readability:

using System;
using System.IO.Compression;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
using System.Linq;
using System.Net;
using System.Text.RegularExpressions;

class C
{
    static void Main()
    {
        var g = WebRequest.Create("https://api.stackexchange.com/2.1/questions/8859?site=codegolf&filter=withbody");
        var r = (HttpWebResponse)g.GetResponse();
        if (r.StatusCode == HttpStatusCode.OK)
        {
            var s=r.GetResponseStream();
            foreach (var a in r.ContentEncoding.ToLowerInvariant().Split(',').Reverse())
            switch(a)
            {
                case "gzip":
                    s = new GZipStream(s,CompressionMode.Decompress);
                    break;
                case "deflate":
                    s = new DeflateStream(s,CompressionMode.Decompress);
                    break;
                default:
                    throw new InvalidOperationException();
            }
            var d = new DataContractJsonSerializer(typeof(R));
            var q = (R)d.ReadObject(s);
            var e = new Regex("<code>([^<]*)</code>");
            var m = e.Match(q.I[0].B);
            Console.WriteLine(m.Groups[1].Value);
        }
    }
}

[DataContract]
public class R
{
    [DataMember(Name="items")]
    public I[] I { get; set; }
}

[DataContract]
public class I
{
    [DataMember(Name="body")]
    public string B { get; set; }
}

The program retrieves this question from Code Golf using Stack Exchange API, finds the first piece of text formatted as code (which, in case of this question, is the “Hello World” text), and prints it out.

\$\endgroup\$
6
  • \$\begingroup\$ That's a pretty creative way to do it! \$\endgroup\$ Commented Nov 1, 2012 at 12:49
  • \$\begingroup\$ This is epic. Very, very cool. \$\endgroup\$
    – Beska
    Commented Nov 1, 2012 at 13:49
  • 8
    \$\begingroup\$ Just hope no one trolls the question to change the question's formatting.... \$\endgroup\$ Commented Nov 1, 2012 at 15:46
  • 2
    \$\begingroup\$ created a profile on code-golf just so I could upvote this question. Epic \$\endgroup\$
    – Ryan
    Commented Nov 1, 2012 at 16:58
  • 1
    \$\begingroup\$ Same as Ryan - added code-golf just to upvote this. Well played. \$\endgroup\$
    – RelicScoth
    Commented Nov 13, 2012 at 13:55
41
\$\begingroup\$

brainfuck

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

This is 1024 characters, excluding the whitespace I added to make a nice 64*16 block.

The strategy is as follows:

  • Fill the first few bytes with characters "Hello World", except each byte is 5 too small. This is done in all but the last 16 characters. The first byte is left blank in order to not have the pointer go out of bounds later.

  • Bring the pointer back to the start, adding 5 to each byte using [+++++<]

  • Go through the characters, print them and zero the byte using >[.[-]>]

\$\endgroup\$
2
  • 4
    \$\begingroup\$ This looks like some form of minimalist art, I like it! \$\endgroup\$ Commented Nov 1, 2012 at 12:50
  • \$\begingroup\$ Gah, ye beat me to it. \$\endgroup\$ Commented Nov 3, 2012 at 3:15
39
\$\begingroup\$

JavaScript (1024 bytes...)

No unnecessary whitespace? What about unnecessary semicolons that JavaScript doesn't need at all? Let's add those semicolons to make people like Crockford happy.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;console.log('Hello World');;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Yes, I'm aware that this is abuse of rules.

\$\endgroup\$
1
  • 3
    \$\begingroup\$ You could also use curly braces, like {{{{{console.log("Hello, World!")}}}}} \$\endgroup\$ Commented Nov 1, 2012 at 17:18
37
\$\begingroup\$

Shell :)

echo '
.@@@@......@@@@.@@@@@@@@@@@.@@.........@@...........@@@@@@@@..
..@@@......@@@..@@.......@@..@..........@..........@........@@.
..@@@......@@@..@............@..........@.........@..........@@
..@@@@@@@@@@@@..@@@@@@.......@..........@.........@..........@@
..@@@@@@@@@@@@..@@@@@@.......@..........@.........@..........@@
..@@@......@@@..@............@..........@.........@..........@@
..@@@......@@@..@@.......@@..@@@@@@@@@@.@@@@@@@@@..@.......@@@.
.@@@@......@@@@.@@@@@@@@@@@..@@@@@@@@@@.@@@@@@@@@...@@@@@@@@..
@@............@@@..@@@@@.....@@@@@@@.....@@........@@@@@@@@@@.
.@@..........@@...@.....@.....@.....@@...@@.........@@.......@.
..@@........@@...@.......@....@.....@@...@@.........@@........@
...@@..@@..@@...@.........@...@@@@@@.....@@.........@@........@
....@@@.@@.@....@........@@...@@@@.@@....@@.........@@........@
....@@...@@@....@.......@@....@.....@@...@@.........@@.......@
...@@......@@....@.....@@.....@......@@..@@@....@@..@@@@...@@.
..@@.......@@@....@@@@@@....@@.......@..@@@@@@@@...@@@@@@@@@'
\$\endgroup\$
1
  • 7
    \$\begingroup\$ The 'W' is a little messed up. \$\endgroup\$ Commented Feb 26, 2013 at 8:52
37
\$\begingroup\$

Mathematica 1024 chars

Graph[Partition[
 Riffle[Characters[
 StringTake[ElementData[][[2]], 3] <> 
  StringTake[WordData["high", "Antonyms"][[2, 2, 1]], 2] <> 
  FromCharacterCode[Power[2, 5]] <> 
  StringTake[GraphData[][[Prime@705]], 2] <> 
  StringTake[AstronomicalData["Planet"][[1]], {3}] <> "ld"], 
Rest@Characters[
  StringTake[ElementData[][[2]], 3] <> 
   StringTake[WordData["high", "Antonyms"][[2, 2, 1]], 2] <> 
   FromCharacterCode[Power[2, 5]] <> 
   StringTake[GraphData[][[Prime[705]]], 2] <> 
   StringTake[AstronomicalData["Planet"][[1]], {3}] <> "ld"]], 
   2] /. {a_, b_} :> DirectedEdge[a, b],

EdgeLabelStyle -> Power[2, 4], 
EdgeLabels -> (Partition[
   Riffle[l = 
     Characters[
      StringTake[ElementData[][[2]], 3] <> 
       StringTake[WordData["high", "Antonyms"][[2, 2, 1]], 
        1 + 1] <> FromCharacterCode[Sqrt[Sqrt[1048576]]] <> 
       StringTake[GraphData[][[Prime[705]]], 2] <> 
       StringTake[AstronomicalData["Planet"][[1]], {3}] <> "ld"], 
    Rest@l], 2] /. {a_, b_} :> DirectedEdge[a, b]) + 
Power[{1, 8, 27, 64, 125, 216, 343, 512, 729, 1000}, 
 1/3] /. {Plus[a_, b_] :> Rule[b, a]}, 
VertexLabelStyle -> Directive[RGBColor[0, 0, 1], Large], 
VertexLabels -> "Name", ImagePadding -> Power[5, 2], 
ImageSize -> 2^2*5^2*7]

graph

De-bowled (partially)

For those who don't have access to Mathematica's curated data:

 ElementData[][[2]]
 WordData["high", "Antonyms"][[2, 2, 1]]
 GraphData[][[Prime[705]]]
 AstronomicalData["Planet"][[1]]

"Helium"

"low"

"WongGraph"

"Mercury"

"Hel" (from "Helium") + "lo" (from "low") + " " (FromCharacterCode[32]) + "Wo" (from "WongGraph") + "r" (from "Mercury") + "ld"

yields the string "Hello World".

The string is split into characters, each of which becomes a vertex in the following graph:

Graph[{"H" \[DirectedEdge] "e", "e" \[DirectedEdge] "l", 
 "l" \[DirectedEdge] "l", "l" \[DirectedEdge] "o", 
 "o" \[DirectedEdge] " ", " " \[DirectedEdge] "W", 
 "W" \[DirectedEdge] "o", "o" \[DirectedEdge] "r", 
 "r" \[DirectedEdge] "l", "l" \[DirectedEdge] "d"},

EdgeLabelStyle -> 16, 
EdgeLabels -> {"H" \[DirectedEdge] "e" -> 1, "e" \[DirectedEdge] "l" -> 2, "l" \ [DirectedEdge] "l" -> 3, 
"l" \[DirectedEdge] "o" -> 4, "o" \[DirectedEdge] " " -> 5, 
" " \[DirectedEdge] "W" -> 6, "W" \[DirectedEdge] "o" -> 7, 
"o" \[DirectedEdge] "r" -> 8, "r" \[DirectedEdge] "l" -> 9, 
"l" \[DirectedEdge] "d" -> 10}, 
VertexLabelStyle -> Directive[Blue, Large], VertexLabels -> "Name", ImagePadding -> 25]
\$\endgroup\$
1
  • 2
    \$\begingroup\$ Wow... that's awesome. \$\endgroup\$ Commented Nov 1, 2012 at 12:47
22
\$\begingroup\$

C, 1024 characters

Here's an adaptation of my answer to another "Hello, world" question:

I'm not sure what's "unnecessary whitespace". I used spaces, indentation and line breaks to make code nicely formatted, but strictly speaking most of it is unnecessary. I did count the whitespace in the 1024 chars.

EDIT: Changed to return! in the first line. Nicer this way, I think.

#include <stdio.h>
int main(int argc, char **argv, char **envp) {
        return!
        putchar(-~-~-~-~-~-~-~-~-~-~!
        putchar(~-~-~-~-~-~-~-~-
        putchar(~-~-~-~-~-~-
        putchar(-~-~-~
        putchar(-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
        putchar(-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
                ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
        putchar(-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
                ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
                -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
                ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
                -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
                ~-~
        putchar(-~-~-~
        putchar(
        putchar(-~-~-~-~-~-~-~
        putchar(-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
        putchar(-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
                ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
                -~-~-~0))))))))))));
}

Another one - Python this time

1024 characters, 944 of them are whitespace, all necessary.

print 11*'%c'%tuple(len(x)+8for x in'                                                                /                                                                                             /                                                                                                    /                                                                                                    /                                                                                                       /                        /                                                                               /                                                                                                       /                                                                                                          /                                                                                                    /                                                                                            '.split('/'))
\$\endgroup\$
3
  • 8
    \$\begingroup\$ lmao: "fatal error C1026: parser stack overflow, program too complex" \$\endgroup\$ Commented Nov 1, 2012 at 15:29
  • \$\begingroup\$ @AK4749, works in ideone.com. \$\endgroup\$
    – ugoren
    Commented Nov 1, 2012 at 16:13
  • \$\begingroup\$ damn visual studio lol \$\endgroup\$ Commented Nov 1, 2012 at 16:51
11
\$\begingroup\$

GolfScript

I had to modify the max length of scripts on http://golfscript.apphb.com/ for this :)

1)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))1)))))))))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))))))))))))))))))))1))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))1))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
)))))1))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))' '1))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))1)))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))1))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))))))))))))))))))))))1))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))1))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))))))))))))))){)}8*]''+

Run the program online here.

\$\endgroup\$
1
  • 8
    \$\begingroup\$ +1 for modifying the max length of golfscript scripts for this... \$\endgroup\$ Commented Nov 1, 2012 at 17:28
7
\$\begingroup\$

Haskell

main=putStrLn hello_world
 where hello_world=show H++ello_world
        where ello_world=show E++llo_world
               where llo_world=show L++lo_world
                      where lo_world=show L++o_world
                             where o_world=show O++_world
                                    where _world=show 𝞝++world
                                           where world=show W++orld
                                                  where orld=show O++rld
                                                         where rld=show R++ld
                                                                where ld=show L++d
                                                                       where d=show D
data Letter=H|E|L|O|𝞝|W|R|D
instance Show Letter where
 show H=["Hello, World!"!!0]
 show E=["Hello, World!"!!1]
 show L=["Hello, World!"!!2]
 show O=["Hello, World!"!!4]
 show 𝞝=["Hello, World!"!!6]
 show W=["Hello, World!"!!7]
 show R=["Hello, World!"!!9]
 show D=["Hello, World!"!!11]
main::IO()

1024 characters, including the (necessary, Haskell is indentation-sensitive!) whitespace. (Though you could remove the line breaks entirely, but who wants an unreadable one-liner? Even now, it's hard enough to guess what this program does, what with the lack of comments...)

\$\endgroup\$
5
\$\begingroup\$

Python 2 - 1024

print''.join(chr(32if c[0]>"z"else """
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita
kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem
ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum
dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero
eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no
sea takimata sanctus est Lorem ipsum dolor sit amet. Duis autem vel enum...
""".count(c[0]+c[1])+99)for c in zip(' yddd~ doda','t iio~doliu')).title()

Writing this program was quite a tedious process, the length of the algorithm (first and last line) impacts the length of the dummy text (to meet the required total number of 1024 characters), which in turn impacts the count of certain substrings... And even worse: Some counts might just not occur with any substring, so I need to adjust the general bias 99, which impacts all other letters. But happily, a helper script is always quickly implemented. :)

\$\endgroup\$
1
  • \$\begingroup\$ Wow. Never thought lorem ipsum would result in hello world. \$\endgroup\$ Commented Feb 19, 2017 at 15:59
4
\$\begingroup\$

Javascript, cut and paste into console (chrome browser of course) on this page to see the page disappear!

function pad_with_zeroes(number, length){
var my_string = '' + number;
while (my_string.length < length){
my_string = '0' + my_string;
}
return my_string;
}
var code_tags = document.getElementsByTagName('code');
var hello_world = code_tags[0].innerHTML;
var body_tags = document.getElementsByTagName('body');
var body = 'NULL';
body = body_tags[0];
var html_input = "<div id='div_that_holds_hello_world' style='font-size:50px; color:#987324; width: 900px; height: 900px; text-align: center;'><span id='hello_world_span'>" +hello_world+ "</span></div>";
body.innerHTML = html_input;
var span = document.getElementById('hello_world_span');
var div = document.getElementById('div_that_holds_hello_world');
var j_c = 1;
var i_c = 0;
var setIn = setInterval(function(){
i_c++;
if(i_c%2 == 0){
span.style.display = 'none';
}else{
span.style.display = 'block';
}
if(i_c%50 != 0){
div.style.fontSize = j_c + 'px';
if(i_c < 1000000){
div.style.color = '#'+ pad_with_zeroes(i_c, 6);
}else{
i_c = 0;
}
j_c++;
}else{
j_c = 0;
}
}, 500);
\$\endgroup\$
3
  • \$\begingroup\$ @JoeTuskan part of that is javascript, like when I create the html for html_input. And part was just cause I was trying to do this very quickly :) \$\endgroup\$
    – Ryan
    Commented Nov 1, 2012 at 18:36
  • \$\begingroup\$ @JoeTuskan there fixed them all (I think) they were not in there to get me on the char count. \$\endgroup\$
    – Ryan
    Commented Nov 1, 2012 at 18:38
  • \$\begingroup\$ comment removed. I'd upvote again if possible :) \$\endgroup\$
    – Joe Tuskan
    Commented Nov 1, 2012 at 19:22
2
\$\begingroup\$

Javascript

Lipsum Test with a regex:

"Hello World|Ta what. Soft lad mardy bum that's champion. Tha knows chuffin' nora tha knows tha knows mardy bum shurrup. Where's tha bin. Any rooad ne'ermind. Is that thine cack-handed ah'll gi' thee a thick ear. Ah'll gi' thee a thick ear. Gerritetten tintintin ah'll learn thi shurrup chuffin' nora. Sup wi' 'im. Nah then soft southern pansy tintintin breadcake t'foot o' our stairs how much. Shu' thi gob be reet th'art nesh thee ah'll gi' thee a thick ear that's champion. Shu' thi gob t'foot o' our stairs tha daft apeth where's tha bin ah'll gi' thi summat to rooer abaht. Wacken thi sen up eeh eeh. Shu' thi gob tha what that's champion soft southern pansy ah'll learn thi a pint 'o mild. Appens as maybe gi' o'er nobbut a lad nobbut a lad.Big girl's blouse a pint 'o mild. Big girl's blouse ah'll learn thi. A pint 'o mild. How much ah'll gi' thi summat to rooer abaht michael palin nay lad. Gerritetten a pint 'o mild be reet nay lad. Nay lad how much ee by gum. 1234567I love feet so much.".match(/Hello World/)[0]

The regex: .match(/Hello World/)[0]

\$\endgroup\$
3
  • \$\begingroup\$ Lots of unnecessary whitespace. \$\endgroup\$
    – ugoren
    Commented Nov 1, 2012 at 22:14
  • 5
    \$\begingroup\$ @ugoren, would you prefer underscores? \$\endgroup\$
    – Joe Tuskan
    Commented Nov 2, 2012 at 1:48
  • \$\begingroup\$ Nice! You could also replace the regex match by a .slice(-N) \$\endgroup\$
    – xem
    Commented Dec 11, 2013 at 10:53
2
\$\begingroup\$

Python

Kinda cheap:

print"""Hello World"""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""
\$\endgroup\$
1
  • 4
    \$\begingroup\$ Could have livened it up a bit with adding some arbitrary strings, and the substringing them off \$\endgroup\$
    – Cruncher
    Commented Dec 4, 2013 at 19:00

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