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