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

Pages: 1-

I'm tired

Name: Anonymous 2009-05-14 1:34

Post some boring code so I can go to sleep.

Name: Anonymous 2009-05-14 1:36

#include <iostream>

int main(){
const int OP = "1"

std::cout << "Good night, >>" << OP << "-san";

return 0;
}

Name: Anonymous 2009-05-14 1:49

getLine >>= (putStr.(++) "Good night, ") >> putStrLn "-san."

Name: Anonymous 2009-05-14 2:01


#!/usr/bin/perl
print "Don't sleep, the clown will eat you\n" while(1);

Name: Anonymous 2009-05-14 2:40

>>2
const int OP = "1"
Shit. That'll teach me to code without my precious IDE!

Name: Anonymous 2009-05-14 2:55

<?php
define("OP", 1);
echo "Good night, >>" . OP . "-san.\n";
?>

Name: Anonymous 2009-05-14 2:58

say "Good night, >>$<-san"

Name: Anonymous 2009-05-14 3:41

" ,thgin dooG">:#,_&.a"nas-".....@

Name: Anonymous 2009-05-14 4:07


public class GoodNightOP {
 public static void main(String[] args) {
  GoodNightOP goodnightop = new GoodNightOP();
  }
 public GoodNightOP() {
  System.out.println("good night OP");
 }
}

Name: Anonymous 2009-05-14 4:11

printf ("%c%c%c%c%c%c%c%c%c%c%c%c%c%c, %s-san\n", 83, 85, 67, 75, 32, 77, 65, 72, 32, 66, 65, 76, 76, 83, nameof(1));

Name: Anonymous 2009-05-14 5:24

Load up in a full screen terminal and enjoy yourself.
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);
    }
}

Name: Anonymous 2009-05-14 5:51

>>11
ENTERPRISE-LEVEL PROGRAMMER

Name: Anonymous 2009-05-14 6:03

>>11
I approve.

Name: Anonymous 2009-05-14 6:20

>>11
Needs more final.

Name: Anonymous 2009-05-14 6:31

>>11
LOL

Name: Anonymous 2009-05-14 14:28

>>13-15
Why does this seem like grotesque samefagging?

Whatever. Hey >>11, call yourself Java-san. Also, what did you mean by "full screen"? Your code did not work nicely in a fullscreen browser at 1440x900 resolution - I think it worked at some 1530 pixels.

Your resolution is quite nonstandard if this is full screen to you. Either that or you use a 1600x1200, probably.

Please be more clear next time, sir.

Name: Anonymous 2009-05-14 21:30

>>16
I meant run it in a fullscreen (F11) terminal, not view it. Then lie down and watch your computer count sheep for you until you fall asleep.

Name: Yoam !.l6k3IYOAM 2009-07-28 6:38

What?

Name: Anonymous 2009-07-28 8:58

>>17
terminal
* Terminal emulator
Sorry, I use a real terminal.

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

//since /prog/ is wasting my time anyway
#include <stdio.h>
#include <stdlib.h>
void main(int argc,char **argv){unsigned long long int sheep=1;while(1){printf("%llu sheep\n",sheep++);sleep(1000);}}


____________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
Never hate your enemies. It clouds your judgment.

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-07-28 10:19

tcc -run sheep.c
1 sheep
2 sheep
3 sheep
4 sheep
5 sheep
6 sheep
7 sheep
8 sheep
9 sheep
10 sheep
11 sheep
12 sheep
13 sheep
14 sheep
15 sheep
16 sheep
17 sheep
18 sheep
19 sheep
20 sheep
21 sheep
22 sheep
23 sheep
24 sheep
25 sheep
26 sheep
27 sheep
28 sheep
29 sheep
30 sheep
31 sheep
32 sheep
33 sheep
34 sheep
35 sheep
36 sheep
37 sheep
38 sheep
39 sheep
40 sheep
41 sheep
42 sheep
43 sheep
44 sheep
45 sheep
46 sheep
47 sheep
48 sheep
49 sheep
50 sheep
51 sheep
52 sheep
53 sheep
54 sheep
55 sheep
56 sheep
57 sheep
58 sheep
59 sheep
60 sheep
61 sheep
62 sheep
63 sheep
64 sheep
65 sheep
66 sheep
67 sheep
68 sheep
69 sheep
70 sheep
71 sheep
72 sheep
73 sheep
74 sheep
75 sheep
76 sheep
77 sheep
78 sheep
79 sheep
80 sheep
81 sheep
^C


________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
The potential for mischief varies inversely with one's proximity to the authority figure.

Name: Anonymous 2009-07-28 10:24


sheep=1
while 1:
    print sheep
    sheep+=1

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-07-28 10:52

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//syntax: EnterpriseSheep [Object [delay[output file]]]
void main(int argc,char **argv){unsigned long long int sheep=1;long int delay=1000;FILE *display;
unsigned char *count=malloc(512);strcpy(count,"%llu ");
if(argv[1]){strcat(count,argv[1]);strcat(count,"\n");}else{strcat(count,"sheep\n");}
if(argv[2] && atoi(argv[2])){delay=atoi(argv[2]);}
if(argv[3]){display=fopen(argv[3],"wb");};if(!display){display=stdout;}
while(1){fprintf(display,count,sheep++);sleep(delay);}}



_______________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
However profound the complicated knowledge of the world, compared to enlightenment it is like one drop of water to the great ocean.

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-07-28 11:09

>>22
#include <stdio.h>
void main(int argc){while(printf("%i sheep\n",argc++));}



__________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
Only after the last tree has been cut down, only after the last river has been poisoned, only after the last fish has been caught, only then will you find, that money cannot be eaten.

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-07-28 11:15

#include <stdio.h>
void main(int argc){sheep:printf("%i sheep\n%i sheep\n%i sheep\n%i sheep\n",argc++,argc++,argc++,argc++);goto sheep;}



_______________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
Men who long for freedom begin the attempt to obtain it by entreating their masters to be kind enough to protect them by modifying the laws which these masters themselves have created!

Name: Anonymous 2009-07-28 11:16

<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>

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-07-28 11:21

#include <stdio.h>
void main(int argc){for(;;printf("%i sheep\n",argc++));}



_______________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
We hold life to be sacred, but we also know the foundation of life consists in a stream of codes not so different from the successive frames of a watchvid. Why then cannot we cut one code short here, and start another there? Is life so fragile that it can withstand no tampering? Does the sacred brook no improvement?

Name: Anonymous 2009-07-28 11:23

[code]10 PRINT "What is your name, OP?"
20 INPUT I$
30 PRINT "Good night, ", I$
40 GOTO 30

Name: Anonymous 2009-07-28 11:24

10 PRINT "What is your name, OP?"
20 INPUT I$
30 PRINT "Good night, ", I$
40 GOTO 30

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-07-28 11:42

<html><head><title>Count sheep page 0</title>
 <body>
</body>
<script>
count=page=1;
function sheepcount(){
if(!(count%10)){document.body.innerHTML+='<br>';}
if(!(count%200)){document.body.innerHTML='';document.getElementsByTagName('title')[0].innerHTML='Count sheep page '+page++;}
document.body.innerHTML+=count+++" sheep,";}
window.setInterval(sheepcount,200);
</script>
</html>



___________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
Flags are bits of colored cloth that governments use first to shrink-wrap people's brains and then as ceremonial shrouds to bury the dead.

Name: Anonymous 2009-07-28 11:53

I can insure you I am no anus!

Name: Anonymous 2009-07-28 11:56

[code](let loop ((index 1))
  (printf "~a Sheep ~n" index)
  (loop (+ index 1)))[code]

Name: toekutr 2010-07-27 17:33

(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))




This was made back a year or so ago, and I still suck at Scheme, but here ya go anyway.

 It goes up to about 10^33, and I'm using a few functions that aren't built into scheme (this was a textbook assignment, here's the list if you want to try this; http://www.cs.berkeley.edu/~bh/ssch27/appendix-simply.html). 



There's also a bug that I never bothered fixing


>(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)


As you can see, it has problems when all three digits of a
"triple" are zeros.

Name: toekutr 2010-07-27 17:33

shit wrong thread

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