Name: Anonymous 2008-09-29 13:09
print "dongs" five times in your favorite language
with extreme conciseness/verbosity
with extreme conciseness/verbosity
print 'dongs'*5
5.times { print "Odelay!" }
main = sequence_ $ replicate 5 $ putStrLn "dongs"
#include <stdio.h>
main() {
size_t i = 5;
for ( ; i; --i, printf( "dongs" ) );
}
MsgBox String(5,"dongs ")
package org.fourchan.text.prog.hurrdurr;
import java.util.List; // for storage
import java.util.ArrayList; // concrete List class
public class Dong {
// value of our Dong object
private final String DONG = "Dong";
// print the value of a list of dongs
public static void main(String[] argv) {
// declare the number of Dongs we want...
final int NUM_DONGS = 5;
// ...and store them in a List
List<Dong> dongs = new ArrayList<Dong>(NUM_DONGS);
// initialize our List of Dongs
for (int i = 0; i < NUM_DONGS; i++) {
dongs.add(new Dong());
}
// print the value of our Dongs
for (Dong d : dongs) {
System.out.println(d);
}
}
// string representation of a Dong
public String toString() {
return this.DONG;
}
}printf("\"dongs\" five times in your favorite language.");
import Control.Monad.Instances
main = putStrLn $ unwords $ (map =<< const) "dongs"
import Control.Monad.Instances
main = (mapM_ =<< const . putStrLn ) "dongs"
(print-dongs-five-times)
i=0
while [ "${i}" -lt 5 ]; do
echo "dongs"
i=`expr "${i}" + 1`
done
main = do
putStrLn "dongs"
putStrLn "dongs"
putStrLn "dongs"
putStrLn "dongs"
putStrLn "dongs"
import Control.Monad.Instances
import List
main = mapM_ (putStrLn . intersperse ' ') $ transpose $ (map =<< const) "dongs"
print 'dongs'x5
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<<<<<<<<<<<<<<<<<<<<<<<<<<<<[.>]
dongsdongsdongsdongsdongs;
;; quintupledongs - displays ``dongs'' five times.
;; based on http://dis.4chan.org/read/prog/1204983387/529
;;
;; This is an example of the sort of computer programs you can write
;; after learning Scheme.
;;
;; Copyright (c) 2008Christopher
;; Contributers:Robert
;;
;; Permission is hereby granted, free of charge, to any person obtaining a copy
;; of this software and associated documentation files (the "Software"), to deal
;; in the Software without restriction, including without limitation the rights
;; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
;; copies of the Software, and to permit persons to whom the Software is
;; furnished to do so, subject to the following conditions:
;;
;; The above copyright notice and this permission notice shall be included in
;; all copies or substantial portions of the Software.
;;
;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
;; THE SOFTWARE.
(write "dongs")
(write "dongs")
(write "dongs")
(write "dongs")
(write "dongs")
(for-each (lambda (x) (display "sgnod")) (range 0 5)))
<html>
<body>
<p>
dongs<br/>
dongs<br/>
dongs<br/>
dongs<br/>
dongs
</p>
</body>
</html>
$aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaacaaaaaaaaaaacbcbbbb
bbbcaaaaaaaaaaaacbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbb$l
cat dongs.txt
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"">
<title/>
<body>
<ul>
<li>dongs</li>
<li>dongs</li>
<li>dongs</li>
<li>dongs</li>
<li>dongs</li>
</ul>
</body>
</html>
dongs M-bkspc C-yyyyy
5adongs
(define (five-dongs)
(letrec ((n-dongs (lambda (num results)
(cond ((> num 0) (n-dongs (- num 1) (append results '(dongs))))
(else results)))))
(display (n-dongs 5 '()))))
(define (enumerate current high function results)
(cond ((< current high)
(enumerate (+ current 1) high function (append results (list (function current)))))
(else results)))
(define (repeat-dongs n)
(enumerate 0 n (lambda (x) 'dongs) '()))
(define (five-dongs)
(repeat-dongs 5))
(display (five-dongs))
for %% in (0 0 0 0 0) do @echo dongs
<!DOCTYPE html>
<title></title>
<ul>
<li>dongs</li>
<li>dongs</li>
<li>dongs</li>
<li>dongs</li>
<li>dongs</li>
</ul>
print 'dongs ' * 5
"GRUNNUR"
yes dongs | head -n5
class Dong():
def __init__(self):
self.text = 'dongs'
def dong(self):
print self.text
dongs = [Dong()]*5
for dong in dongs:
dong.dong()
#include <iostream>
#include <string>
#include <vector>
int main(void)
{
std::vector<std::string> d(5, "dongs ");
std::vector<std::string>::iterator dicks = d.begin();
while(dicks != d.end())
{
std::cout << *dicks;
++dicks;
}
std::cout << std::endl;
return 0;
}
section .data
msg db "dong",10,0
section .text
extern printf
global main
main:
mov ebx, 5
dongloop:
push msg
call printf
add esp,8
dec ebx
jnz dongloop
mov eax, 1
int 80h
section .data
dong: db "dong", 10
donglen equ $-dong
section .text
global _start
_start:
mov ecx, 5
.dong
push ecx
mov eax, 4
mov ebx, 1
mov ecx, dong
mov edx, donglen
int 80h
pop ecx
loop .dong
mov eax, 1
xor eax, eax
int 80h
ldx #$ff
bne :++
: jsr $ffd2
: inx
lda text,x
bne :--
rts
text: "dongs",13,0
ldy #4
: ldx #$ff
bne :++
: jsr $ffd2
: inx
lda text,x
bne :--
dey
bpl :---
rts
text: "dongs",13,0
puts "ᛞᛟᛝᛋ᛫ᛞᛟᛝᛋ᛫ᛞᛟᛝᛋ᛫ᛞᛟᛝᛋ᛫ᛞᛟᛝᛋ᛬"puts "᚛ᚂᚑᚍᚄ ᚂᚑᚍᚄ ᚂᚑᚍᚄ ᚂᚑᚍᚄ ᚂᚑᚍᚄ᚜"
#include <iostream>
template <int N>
class dongs {
public:
dongs() {
std::cout << "dongs";
}
private:
dongs<N - 1> dong;
};
template <>
struct dongs<0> {
};
int main()
{
dongs<5>();
return 0;
}
#include <iostream>
#include <string>
template < int N > struct dongs { static const std::string v; };
template < int N > const std::string dongs<N>::v = dongs< N - 1 >::v + "dongs";
template <> struct dongs<0> { static const std::string v; };
const std::string dongs<0>::v = "";
int main() {
std::cout << dongs<5>::v;
return 0;
}
CREATE TABLE Dong (
dongid INTEGER AUTO_INCREMENT,
dong VARCHAR2(5),
PRIMARY KEY(dongid)
);
CREATE OR REPLACE PROCEDURE InsertDongs(numDongs IN INTEGER) AS
invalidParameter EXCEPTION;
BEGIN
IF numDongs IS NULL THEN RAISE invalidParameter
END IF;
IF numDongs < 1 THEN RAISE invalidParameter
END IF;
FOR i IN 1 .. numDongs LOOP
INSERT INTO Dong(dong)
VALUES('dongs');
END LOOP;
EXCEPTION
WHEN invalidParameter THEN DBMS_OUTPUT.PUT_LINE('bad paramter recieved');
WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;
END InsertDongs;
IsertDongs(5);
SELECT dong
FROM Dong;
#include <iostream>
#include <string>
template < int N > struct dongs { static const std::string v; };
template < int N > const std::string dongs<N>::v = dongs< N - 1 >::v + "dongs";
template <> const std::string dongs<0>::v = "";
int main() {
std::cout << dongs<5>::v;
return 0;
}printf("udonge\n");
printf("udonge\n");
printf("udonge\n");
printf("udonge\n");
printf("udonge\n");
#include <stdio.h>
int main(int argc, char **argv) {
int i = 5;
while (i--)
printf("%s\n", "ドングズ");
return 0;
}
(define (print-dongs x) (if (> x 0) (begin (write "dongs ") (print-dongs (- x 1)))))
(print-dongs 5)
PROC hax(CHAN OF BYTE anus)
WHILE TRUE
out.string("dongs", 0, anus)
:
PROC fioc(CHAN OF BYTE keyboard, my_anus, error)
hax(my_anus)
:
mapM_ (\ _ -> putStrLn "dongs") [1/0, 0/0, sqrt (-1), sum [ 9*10^^n | n <- [-1, -2 ..] ], undefined]
#include <stdio>
void main () {
for (int i = 5; i > 0; i--) printf("dongs\n");
}
<stdio>
HAI
CAN HAS STDIO?
I HAS A VAR
IM IN YR LOOP
UP VAR!!1
VISIBLE "DONGS"
IZ VAR BIGGER THAN 4? KTHXBYE
IM OUTTA YR LOOP
KTHXBYE
import sys
map(sys.stdout.write, ["dongs\n" for dong in range(0,5)])main(){for(int i=5;--i;puts("dongs"));}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd"
xml:lang="en" >
<head>
<title>Repitition demonstration</title>
</head> <body>
<ul>
<li>dongs</li>
<li>dongs</li>
<li>dongs</li>
<li>dongs</li>
<li>dongs</li>
</ul>
</body>
</html>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml">
<xsl:template match="dongs">
<html>
<head>
<title>Repetition</title>
</head>
<body>
<ul>
<xsl:call-template name="loop">
<xsl:with-param name="times">5</xsl:with-param>
</xsl:call-template>
</ul>
</body>
</html>
</xsl:template>
<xsl:template name="loop">
<xsl:param name="times"/>
<xsl:if test="$times > 0">
<li>dongs</li>
<xsl:call-template name="loop">
<xsl:with-param name="times"><xsl:value-of select="$times - 1"/></xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
$ echo dongs dongs dongs dongs dongs
def print str 1 = print $str + " " end
def print str n = $str + " " + (print n-1) end
print "dongs" 5
"DONGS
LETi+=1
IFi>4
repeat 5 echo dongs
(print "dongs")*55 [ "dongs" print ] times5.times { puts "dongs" }
concat $ repeat [(concat $ replicate 3 "badger badger badger "),"MUSHROOM MUSHROOM"]
cycle = concat . repeat
repeat = cycle - concat
putStr xs = (putChar x)*xs
data Mushroom badger = Mushroom badger badger badger badger badger badger badger badger badger
deriving Snake
print (("badger\n"*12+"mushroom\n"*2)*2+"badger\n"*12+"snake a snake oh it's a snake\n\n")*int(raw_input("how many times:"))
(format t "~{~a~}" (list "dongs" "dongs" "dongs" "dongs" "dongs"))
replicateM_ 5(putStrLn"dongs")