Name: Anonymous 2008-09-29 13:09
print "dongs" five times in your favorite language
with extreme conciseness/verbosity
with extreme conciseness/verbosity
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" }