Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

Challenge

Name: Anonymous 2009-08-08 2:51

Write a program which creates a file named DICKS.HTML and writes "<html><body>DICKSDICKSDICKS</body></html>" inside.
Language with the shortest code wins.

Name: Anonymous 2009-08-08 3:11

Do your own homework.

Name: Anonymous 2009-08-08 3:17

>>2
Am I my own homework?

Name: Anonymous 2009-08-08 3:18

>>1
Uh, wouldn't it make more sense to serve it over the Internet by some means?
(with-open-file (f "DICKS.HTML :direction :output)
  (with-html-output (f)
    (:html (:body "DICKSDICKSDICKS"))))


Why such a trivial challenge?

Name: Anonymous 2009-08-08 3:18

#include <iostream>
#include <fstream>
using namespace std;

int main () {
  ofstream dicks;
  dicks.open ("DICKS.HTML");
  dicks<< "<html><body>DICKSDICKSDICKS</body></html>";
  dicks.close();
  return 0;
}

Name: Anonymous 2009-08-08 3:21


#! /bin/sh
echo \<html\>\<body\>DICKSDICKSDICKS\</body\>\</html\> > DICKS.HTML

Name: Anonymous 2009-08-08 3:35

<html><body>DICKSDICKSDICKS</body></html> > DICKS.HTML

no need for echo

Name: Anonymous 2009-08-08 3:36

>>6
#!/bin/sh
echo '<html><body>DICKSDICKSDICKS</body></html>' > DICKS.HTML

Optimized that for you.

Name: Anonymous 2009-08-08 4:00

<?$c="DICKS";file_put_contents("$C.HTML","<html><body>$c$c$c</body></html>"

Name: Anonymous 2009-08-08 4:01

d=DICKS;echo "<html><body>$d$d$d</body></html>">$d.HTML
Optimized that for you.

Name: Anonymous 2009-08-08 4:11

>>4 116 bytes
>>5 218 bytes
>>6 79 bytes
>>7 54 bytes
>>8 72 bytes
>>9 76 bytes
>>10 55 bytes

Name: 2009-08-08 4:20

open('data:,¬¬¬')

Name: Anonymous 2009-08-08 4:35

import java.io.*;
public class Dicks {
    public static void main(String[] args) throws IOException {
        PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(new File("DICKS.HTML"))));
        pw.write("<html><body>DICKSDICKSDICKS</body></html>");
        pw.close();
    }
}

Name: Anonymous 2009-08-08 5:10

<?php

function dicks()
        {
                print("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
                print("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\n");
                print("        \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n");
                print("\n");
                print("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\n");
                print("<head>\n");
                print("        <meta http-equiv=\"Content-type\" content=\"text/html;charset=us-ascii\" />\n");
                print("        <title>DICKS</title>\n");
                print("</head>\n");
                print("\n");
                print("<body>\n");
                print("\n");
                print("        <p id=\"dicks\">DICKSDICKSDICKS</p>\n");
                print("\n");
                print("        <p id=\"valid\">\n");
                print("                <a href=\"http://validator.w3.org/check?uri=referer\">\n");
                print("                        <img src=\"http://www.w3.org/Icons/valid-xhtml11\"\n");
                print("                             alt=\"Valid XHTML 1.1\"\n");
                print("                             height=\"31\"\n");
                print("                             width=\"88\"\n");
                print("                        />\n");
                print("                </a>\n");
                print("        </p>\n");
                print("\n");
                print("</body>\n");
                print("</html>\n");
                \n");
        } 
       
dicks();

?>

Name: Anonymous 2009-08-08 5:56

>>11
>>7 54 bytes
Doesn't count if it's not valid code.

Name: Anonymous 2009-08-08 6:24

I have modified the HQ9+ language to include the 'd' instruction, which prints <html><body>DICKSDICKSDICKS</body></html>" to a file named ``DICKS.HTML''. Here is the complete programme:

d

Name: Anonymous 2009-08-08 6:41

>>16
My fork of HQ9+(HQ++) treats empty files as instruction to do the above in 0 bytes.

Name: xkcd 2009-08-08 6:43

In my world all you need is butterfly flapping its wings in special manner to trigger >>17 (no files required)

Name: Anonymous 2009-08-08 6:51

>>18
Eat cheeseburgers, Randy!

Name: Anonymous 2009-08-08 8:47

#include <stdio.h>
int main()
{
     FILE *fp;
     fp = fopen("DICKS.HTML", "w");
     fputs("<html><body>DICKSDICKSDICKS</body></html>", fp);
     fclose(fp);
}


A few lines shorter than the C++ one. >>5

dicks.exe      15.6 KB
dicks++.exe    464 KB


What the fuck is that about?

Name: Anonymous 2009-08-08 9:03

>>20
lol Sepples

Name: QBasic 2009-08-08 9:03

10 OPEN FILE "DICKS.HTML" AS #1
20 PRINT #1, "<html><body>DICKSDICKSDICKS</body></html>"
30 CLOSE #1

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-08-08 9:26

main(){fputs("<html><body>DICKSDICKSDICKS</body></html>",fopen("DICKS.HTML","w"));}
83 bytes source, run with Tiny C Compiler.
1536 bytes .exe 586bytes compressed in 7z(PPMD)


_______________________________
http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
Justice is not revenge - it's deciding for a solution that is oriented towards peace, peace being the harder but more human way of reacting to injury. That is the very basis of the idea of rights.

Name: Anonymous 2009-08-08 9:27

open$f,'>DICKS.HTML';print$f '<html><body>','DICKS'x3,'</body></html>'

Name: Anonymous 2009-08-08 9:28

One liner
(with-output-to-file "DICKS.HTML" (lambda () (display "<html><body>DICKSDICKSDICKS</body></html>")))

Name: Anonymous 2009-08-08 9:30

>>25
I see >>4 already beat me to it, damn

Name: Anonymous 2009-08-08 9:58

Complete ELF executable, 146 bytes. dump into a binary file using xxd.

0000000: 7f45 4c46 0101 0100 0000 0000 0000 0000  .ELF............
0000010: 0200 0300 0100 0000 5480 0408 3400 0000  ........T...4...
0000020: a400 0000 0000 0000 3400 2000 0100 2800  ........4. ...(.
0000030: 0300 0200 0100 0000 0000 0000 0080 0408  ................
0000040: 0080 0408 9200 0000 9200 0000 0500 0000  ................
0000050: 0010 0000 b004 31db 43b9 6980 0408 31d2  ......1.C.i...1.
0000060: b229 cd80 31c0 40cd 803c 6874 6d6c 3e3c  ....1.@..<;html><
0000070: 626f 6479 3e44 4943 4b53 4449 434b 5344  body>DICKSDICKSD
0000080: 4943 4b53 3c2f 626f 6479 3e3c 2f68 746d  ICKS</body></htm
0000090: 6c3e                                     l>

Name: Anonymous 2009-08-08 10:01


0000000: 7f45 4c46 0101 0100 0000 0000 0000 0000  .ELF............
0000010: 0200 0300 0100 0000 5480 0408 3400 0000  ........T...4...
0000020: a400 0000 0000 0000 3400 2000 0100 2800  ........4. ...(.
0000030: 0300 0200 0100 0000 0000 0000 0080 0408  ................
0000040: 0080 0408 9200 0000 9200 0000 0500 0000  ................
0000050: 0010 0000 b004 31db 43b9 6980 0408 31d2  ......1.C.i...1.
0000060: b229 cd80 31c0 40cd 803c 6874 6d6c 3e3c  ....1.@..<;;html><
0000070: 626f 6479 3e44 4943 4b53 4449 434b 5344  body>DICKSDICKSD
0000080: 4943 4b53 3c2f 626f 6479 3e3c 2f68 746d  ICKS</body></htm
0000090: 6c3e

Name: Anonymous 2009-08-08 10:15

>>23
fputs before fopen() and then failing to close the fucking file
Jesus Christ you are the most useless piece of shit excuse for a "programmer" on the face of the planet.

Name: Anonymous 2009-08-08 10:52

>>29
fputs before fopen() and then failing to close the fucking file
Jesus Christ you are the most useless piece of shit excuse for a "programmer" on the face of the planet.

Name: Anonymous 2009-08-08 11:01

ruby -e'puts"<html><body>#{"DICKS"*3}</body></html>"'>DICKS.HTML

Name: Anonymous 2009-08-08 11:07

>>30
Frozen-Crybaby getting grouchy and posting as Anonymous
I'm sorry your threads have been spoiled pal ;(  Maybe one of the other chans will give a shit about your visionary vaporware project.

Name: Anonymous 2009-08-08 11:16

this is so stupid, why don't you just make a DICKS.HTML file.. fuck making a program to do it

Name: Anonymous 2009-08-08 11:45

>>32
Sure, hide behind your paranoia, but you still can't program for shit.

Name: Anonymous 2009-08-08 12:44

#! cat>DICKS.HTML
<html><body>DICKSDICKSDICKS</body></html>

Name: Shitnipple 2009-08-08 12:53

>>32
fopen()'s return value is being passed to fputs. Files are closed on exit(). You fucking lose.

Name: Anonymous 2009-08-08 17:17


echo "<html><body>DICKSDICKSDICKS</body></html>" > DICKS.HTML

Name: Anonymous 2009-08-08 19:49

dicks
S a = "/DICKS.HTML" O a:"NWS" U a W "<html><body>DICKSDICKSDICKS</body></html>" C a Q

Compiles and runs successfully. Written in MUMPS.

Name: Anonymous 2009-08-08 22:59

>>35
Not only does this not work, but it's also retarded.

Name: Anonymous 2009-09-12 10:28

hi

Name: Anonymous 2009-09-12 10:38

>>5
dicks.close();
I lol'd at this for some reason

Name: Anonymous 2009-09-12 10:56

GEE, WE HAVEN'T HAD THIS THREAD IN A WHILE.

Name: Anonymous 2009-09-12 11:20

This thread (still) sucks. And I'd urge everyone to properly encapsulate their dicks, perhaps using the GoF "Dick in a Box" pattern. You'll be glad you did, and so will she.

Name: Anonymous 2009-09-12 11:31

>>20
dicks.exe      15.6 KB
dicks++.exe    464 KB

a.out          1,2K
What the fuck is that about?

Name: Anonymous 2009-09-12 11:47

>>44

B-b-b-b-boilerplate.

Name: Anonymous 2009-09-12 11:58

# Forbes' Indentured Kobe
dicks = open("DICKS.HTML", "w")
dicks.write("<html><body>DICKSDICKSDICKS</body></html>")
dicks.close()

Name: Anonymous 2009-09-12 11:58

>>46

whoops

Name: Anonymous 2009-09-12 11:59


# Forbes' Indentured Kobe
dicks = open("DICKS.HTML", "w")
dicks.write("<html><body>DICKSDICKSDICKS</body></html>")
dicks.close()

Name: Anonymous 2009-09-12 13:28

cat z>DICKS.HTML

Name: Anonymous 2009-09-12 16:11


f=open("DICKS.html", "w")
f.write("<html><body>"+"DICKS"*3+"</body></html>")
f.close()

Name: Anonymous 2009-09-12 16:14

>>50
Did you mean
with open("Dicks.html","w") as f:
    f.write("<html><body>" + "DICKS"*3 + "</body></html>")
?

Name: Anonymous 2009-09-12 17:15

>>51
Oh, you can do that in Python? You learn something new every day.

Name: Anonymous 2009-09-12 17:48


import sys

write_file_mode = 'w'
output_file_to_write_dicks_in = 'D' + 'I' + 'C' + 'K' + 'S' + '.' + 'H' + 'T' + 'M' + 'L'
message_to_write_to_dicks_file = '<' + 'h' + 't' + 'm' + 'l' + '>' + '<' + 'b' + 'o' + 'd' + 'y' + '>' + 'D' + 'I' + 'C' + 'K' + 'S' + 'D' + 'I' + 'C' + 'K' + 'S' + 'D' + 'I' + 'C' + 'K' + 'S' + '<' + '/' + 'b' + 'o' + 'd' + 'y' + '>' + '<' + '/' + 'h' + 't' + 'm' + 'l' + '>'
sys_error_code_ok = 0

open_file_to_write_dicks_message_to = open(output_file_to_write_dicks_in,write_file_mode)
open_file_to_write_dicks_message_to.write(message_to_write_to_dicks_file)
open_file_to_write_dicks_message_to.flush()
open_file_to_write_dicks_message_to.close()

sys.exit(sys_error_code_ok)

Name: Anonymous 2009-09-12 20:04

I just created the "dicksdicksdicks" programming language for exactly this purpose. In the dicksdicksdicks language, ANY source code will compile to a program that does exactly what you requested - including the empty source file. So I just made an implementation with a zero length source file.

I win :)

Name: Anonymous 2009-09-12 20:53

>>54
Already been done.

Name: Anonymous 2009-09-12 21:36

newLISP

(eval-string(apply(fn(s r)(replace(first r)s r))'({(write-file "D.HTML" "<h<bDDD</h</b")}"html>""body>""DICKS")2))

Name: Anonymous 2009-09-12 23:41

>>51

Son of a bitch.

Name: Anonymous 2009-09-13 0:46

I'm surprised nobody has proposed a language that does this with no source file at all.

Name: Anonymous 2009-09-13 1:21

>>58
It has already been proposed.

Twice.

Name: Anonymous 2009-09-13 2:23

>>58
Do you even attempt to read a thread before posting in it?

Name: Anonymous 2009-09-13 3:23

>>56
6 chars shorter

(eval-string(apply(fn(s r)(replace(r 0)s r))'({(write-file"D.HTML""<h<bDDD</h</b")}"html>""body>""DICKS")2))

Name: Anonymous 2009-09-13 11:11

In a language I'm currently designing:

“DICKS.HTML”,“w”→Φ→α▪
“<html><body>%s</body></html>∗n”→γ▪
“DICKS”·3→δ▪
αγδ→Π▪
Ξ←α▪
0→Ω▪

Name: Anonymous 2009-09-13 11:17

>>62
Keep us informed on how that turns out :)

Name: Anonymous 2009-09-13 11:18

>>62
APL++

Name: Anonymous 2009-09-13 11:38

>>63
Currently I can't decide on the multiplication operator between ·, ★, ∗, ∘, × (·, ★, ∗, ∘, ×).

Name: Anonymous 2009-09-13 11:54

Name: Anonymous 2009-09-13 11:55

>>65
Maybe you should start by learning how to sage?

Name: Anonymous 2009-09-13 12:01

>>67
what?

Name: Anonymous 2009-09-13 19:30

>>63
I don't know if you were being sarcastic, but I just finished the parser in Haskell.
I changed the multiplication operator to × and the escape character to ♯.
Now to write the compiler...

Name: Anonymous 2009-09-13 20:42

>>66
that's actually the buddhist symbol for peace

Name: Anonymous 2009-09-13 20:45

>>70
So? Are you saying that it wouldn't make a good multiplication symbol?

Name: Anonymous 2009-09-13 21:34

>>70
The swastika is a lot older than Buddhism, and isn't a symbol for peace. It's just a general auspicious thing.
Maybe you thought you were clever by mentioning it, but by now, this sort of thing is common knowledge, in large part because of people like you who think half-remembered trivia is impressive.

Name: Anonymous 2010-12-22 11:18

Don't change these.
Name: Email:
Entire Thread Thread List