Name: Anonymous 2009-05-14 1:34
Post some boring code so I can go to sleep.
#include <iostream>
int main(){
const int OP = "1"
std::cout << "Good night, >>" << OP << "-san";
return 0;
}
getLine >>= (putStr.(++) "Good night, ") >> putStrLn "-san."
#!/usr/bin/perl
print "Don't sleep, the clown will eat you\n" while(1);
<?php
define("OP", 1);
echo "Good night, >>" . OP . "-san.\n";
?>
say "Good night, >>$<-san"
" ,thgin dooG">:#,_&.a"nas-".....@
public class GoodNightOP {
public static void main(String[] args) {
GoodNightOP goodnightop = new GoodNightOP();
}
public GoodNightOP() {
System.out.println("good night OP");
}
}
import java.math.BigInteger;
import java.util.TimerTask;
import java.util.Timer;
public class CountSheep extends TimerTask {
private static java.math.BigInteger num = java.math.BigInteger.ONE;
private static String[] mantissa = {"zero", "one", "two", "three", "four", "five", "six",
"seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen",
"fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"};
private static String[] exponent = {"", "thousand", "million", "billion", "trillion", "quadrillion",
"quintillion", "sexillion", "septillion", "octillion", "nonillion", "decillion",
"undecillion", "duodecillion", "tredecillion","quattuordecillion", "quindecillion", "sexdecillion",
"septdecillion", "octodecillion", "novemdecillion", "vigintillion", "unvigintillion", "duovigintillion",
"trevigintillion", "quattuorvigintillion", "quinvigintillion", "sexvigintillion", "septvigintillion", "octovigintillion",
"novemvigintillion", "trigintillion", "untrigintillion", "duotrigintillion", "tretrigintillion", "quattuortrigintillion",
"quintrigintillion", "sextrigintillion", "septtrigintillion", "octotrigintillion", "novemtrigintillion", "quadragintillion",
"unquadragintillion", "duoquadragintillion", "trequadragintillion", "quattuorquadragintillion", "quinquadragintillion", "sexquadragintillion",
"septquadragintillion", "octoquadragintillion", "novemquadragintillion", "quinquagintillion", "unquinquagintillion", "duoquinquagintillion",
"trequinquagintillion", "quattuorquinquagintillion", "quinquinquagintillion", "sexquinquagintillion", "septquinquagintillion",
"octoquinquagintillion",
"novemquinquagintillion", "sexagintillion", "unsexagintillion", "duosexagintillion", "tresexagintillion", "quattuorsexagintillion",
"quinsexagintillion", "sexsexagintillion", "septsexagintillion", "octosexagintillion", "novemsexagintillion", "septuagintillion",
"unseptuagintillion", "duoseptuagintillion", "treseptuagintillion", "quattuorseptuagintillion", "quinseptuagintillion", "sexseptuagintillion",
"septseptuagintillion", "octoseptuagintillion", "novemseptuagintillion", "octogintillion", "unoctogintillion", "duooctogintillion",
"treoctogintillion", "quattuoroctogintillion", "quinoctogintillion", "sexoctogintillion", "septoctogintillion", "octooctogintillion",
"novemoctogintillion", "nonagintillion", "unnonagintillion", "duononagintillion", "trenonagintillion", "quattuornonagintillion",
"quinnonagintillion", "sexnonagintillion", "septnonagintillion", "octononagintillion", "novemnonagintillion", "centillion"};
private static String[] tens = {"twenty", "thirty", "fourty", "fifty", "sixty", "seventy", "eighty", "ninety"};
private static String bigIntToEnglish(BigInteger b) {
StringBuilder s = new StringBuilder();
for(int i=0; i<exponent.length; i++) {
BigInteger n = BigInteger.valueOf(1000).pow(i);
if(n.compareTo(b)>0) {
n = BigInteger.valueOf(1000).pow(i-1);
BigInteger m = b.divide(n);
BigInteger r = b.subtract(m.multiply(n));
int a = m.intValue() / 100;
int c = m.intValue() % 100;
if(a>0) {
s.append(mantissa[a]+" hundred");
if(c>0) s.append(" and ");
}
if(c>0) {
if(c<20) s.append(mantissa[c]);
else for(int j=0; j<tens.length; j++) {
if(30 + 10*j > c) {
s.append(tens[j]);
if(c%10!=0) s.append(" "+mantissa[c%10]);
break;
}
}
}
s.append(" "+exponent[i-1]);
if(!r.equals(BigInteger.ZERO)) s.append(" "+bigIntToEnglish(r));
return s.toString();
}
}
return "Overflow";
}
public void run() {
String s = bigIntToEnglish(num);
System.out.println(Character.toUpperCase(s.charAt(0))+s.substring(1)+"sheep.");
num = num.add(BigInteger.ONE);
}
public static void main(String[] args) {
new Timer().scheduleAtFixedRate(new CountSheep(),0,100);
}
}
sheep=1
while 1:
print sheep
sheep+=1
<html>
<head>
<title>Good night OP-san</title>
<script type="text/javascript">
function goodnightOP() {
while (true) {
document.write("Good night OP");
}
}
</script>
</head>
<body onload="goodnightOP();">
</body>
</html>
10 PRINT "What is your name, OP?"
20 INPUT I$
30 PRINT "Good night, ", I$
40 GOTO 30
(require simply.scm)
(define (number-name num)
(name-triples (sub-in-names (make-triples num) namelist)))
(define (name-triples triples)
(cond
((empty? triples) '())
((number? (first triples)) (se (name-triple (first triples)) (name-triples (bf triples))))
(else (se (first triples) (name-triples (bf triples))))))
(define (make-triples num)
(cond
((empty? num) '())
((= (length num) 2) num)
((= (length num) 1) num)
(else
(se (make-triples (bl (bl (bl num)))) (last-three num)))))
(define (length num)
(if (empty? num)
0
(+ 1 (length (bf num)))))
(define (last-three wd)
(word (last (bl (bl wd))) (last (bl wd)) (last wd)))
(define (sub-in-names triples names)
(cond
((<= (length triples) 1) (se triples (first names)))
((> (length triples) 12) '(Overflow, try entering a smaller number))
(else (if (all-zeros? (last triples))
(se (sub-in-names (bl triples) (bf names)) (last triples))
(se (sub-in-names (bl triples) (bf names)) (first names) (last triples))))))
(define (name-triple triple)
(let ((fst (first triple)) (rest (bf triple)))
(cond
((= (length triple) 3)
(if (= fst 0)
(se (name-triple rest))
(se (name-single (first triple)) 'hundred (name-triple (bf triple)))))
((= (length triple) 2)
(if (= fst 0)
(se (name-single rest))
(cond
((= fst 1) (cond
((= triple 10) 'ten)
((= triple 11) 'eleven)
((= triple 12) 'twelve)
((= triple 13) 'thirteen)
((= triple 14) 'fourteen)
((= triple 15) 'fifteen)
((= triple 16) 'sixteen)
((= triple 17) 'seventeen)
((= triple 18) 'eighteen)
(else 'nineteen)))
((= fst 2) (se 'twenty (name-triple rest)))
((= fst 3) (se 'thirty (name-triple rest)))
((= fst 4) (se 'forty (name-triple rest)))
((= fst 5) (se 'fifty (name-triple rest)))
((= fst 6) (se 'sixty (name-triple rest)))
((= fst 7) (se 'seventy (name-triple rest)))
((= fst 8) (se 'eighty (name-triple rest)))
((= fst 9) (se 'ninety (name-triple rest)))
(else (se (name-triple rest))))))
(else
(name-single triple)))))
(define (name-single num)
(if empty? num) '(Whoops)
(cond
((= num 0) '())
((= num 1) 'one)
((= num 2) 'two)
((= num 3) 'three)
((= num 4) 'four)
((= num 5) 'five)
((= num 6) 'six)
((= num 7) 'seven)
((= num 8) 'eight)
(else 'eight)))
(define (name-triples triples)
(cond
((empty? triples) '())
((number? (first triples)) (se (name-triple (first triples)) (name-triples (bf triples))))
(else (se (first triples) (name-triples (bf triples))))))
(define namelist '(thousand million billion trillion quadrillion quintillion
sextillion septillion octillion nonillion decillion))
>(number-name 12000123)
'(twelve million thousand one hundred twenty three)
>(number-name 12010123)
'(twelve million ten thousand one hundred twenty three)
>(number-name 1231231352344135)
'(one quadrillion two hundred thirty one trillion two hundred thirty one billion three hundred fifty two
million three hundred forty four thousand one hundred thirty five)