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

Pages: 1-4041-

Homework

Name: Anonymous 2009-04-01 16:01

Take a number from the standard input and output "Sussman" this many times, using Python.

Name: Anonymous 2009-04-01 16:11

print "Sussman\n" * int(raw_input())

Name: dude 2009-04-01 16:11


import java.util.*;
public class A{
 public static void main(String[] b){
   int n=new Scanner(System.in).nextInt();
   for(int i=0;i<n;i++)System.out.print("Sussman");
 }
}

Name: Anonymous 2009-04-01 16:20


main = getLine >>= \l -> putStrLn $ concat $ replicate (read l) "Sussman\n"

Name: Anonymous 2009-04-01 16:25

getLine >>= (\n -> mapM_ putStrLn $ flip replicate "Sussman" (read n))

Name: Anonymous 2009-04-01 16:26

>>4
Hey.

Name: Anonymous 2009-04-01 16:31

main flip = replicateM_ (putStrLn "Sussman") . read =<< getLine

Name: >>7 2009-04-01 16:32

Oops.

main = flip replicateM_ (putStrLn "Sussman") . read =<< getLine

Name: Anonymous 2009-04-01 17:20


n = read
if n = 1 then
   print sussman
else if n = 2 then
      print sussman sussman
   else if n = 3 then
         print sussman sussman
      else if n = 4 then
            print sussman sussman
         else if n = 5 then
               print sussman sussman
            else if n = 6 then
                  print sussman sussman

Name: Anonymous 2009-04-01 17:20

>>8
proof that haskell fails

Name: Anonymous 2009-04-01 18:03

>>10
You're not even trying.

Name: Anonymous 2009-04-01 22:36

>>5

getLine >>= \n -> mapM_ putStrLn $ flip replicate "Sussman" $ read n

Name: Anonymous 2009-04-01 22:58

Lets see you do this in Haskell.

import java.io.*;
import java.util.*;
import java.lang.reflect.*;
public class Sussmans {
    private static final String FILENAME = "SussmansPrint.java";
    public static void main(String[] args) throws Exception {
        String base = FILENAME.substring(0,FILENAME.lastIndexOf("."));
        System.out.print("Please enter the number of Sussmans you wish to print: ");
        int i = (new Scanner(System.in)).nextInt();
        PrintWriter pw = new PrintWriter(new FileOutputStream(FILENAME));
        pw.write("public class "+base+" {\n"+
                "\tpublic static void main(String[] args) {\n");
        for(int k=0; k<i; k++) {
            pw.write("\t\tSystem.out.print(\"Sussman\");\n");
        }
        pw.write("\t}\n"+
                "}");
        pw.close();
        Process compiler = Runtime.getRuntime().exec("javac "+FILENAME);
        compiler.waitFor();
        SussClassLoader CLoad = new SussClassLoader();
        Class bytecode = CLoad.findClass(base);
        Class[] argz = { (new String[0]).getClass() };
        Method main = bytecode.getMethod("main", argz);
        String[] arguments = new String[args.length];
        System.arraycopy(args, 0, arguments, 0, arguments.length);
        Object[] arges = {arguments};
        main.invoke(null, arges);
        System.exit(0);
    }
}
class SussClassLoader extends ClassLoader {
    public Class findClass(String fname) {
        File file = new File(fname+".class");
        try {
            byte[] bytes = new byte[(int)(file.length())];
            FileInputStream fis = new FileInputStream(file);
            fis.read(bytes);
            fis.close();
            return defineClass(fname, bytes, 0, bytes.length);
        }
        catch(Exception e) {
            System.out.println(e.getMessage());
            return null;
        }
    }
}

Name: Anonymous 2009-04-02 0:18

>>13
I LOVE YOU! I LOVE YOUR POST! I READ IT 5 TIMES! KEEP POSTING!

Name: Anonymous 2009-04-02 0:23

Java = fail. Go back to M$ fgt.

Name: Anonymous 2009-04-02 0:23

>>14
back to /b/ please

Name: Anonymous 2009-04-02 2:31

>>8
main = readLn >>= (`replicateM_` putStr "Sussman\n")

Name: Anonymous 2009-04-02 3:04

10 INPUT A
20 FOR X = 1 TO A
30 PRINT "SUSSMAN"
40 NEXT A

Name: Anonymous 2009-04-02 3:07

spoiler!!!! y u look here?

Name: Anonymous 2009-04-02 3:10

print "Sussman\n"x<>

Name: Anonymous 2009-04-02 3:21

while True:
    a = int(input('enter a number'))
    if a == 69:
        break
    print('susman \n' * a)

Name: Anonymous 2009-04-02 3:22

test code input z
[c]dsad[/c]
I cant bbcode

Name: Anonymous 2009-04-02 3:41

{ok, [N]} = io:fread("","~d"),
io:put_chars(lists:duplicate(N,"Sussman\n")).

Name: Anonymous 2009-04-02 4:30

>>14
First time someone had said this to me and it really does feel great. Thanks Anon, you made my day.

Name: Anonymous 2009-04-02 4:53

puts "you're answer is among these:"; 65534.times {|s| puts "#{s+2} Sussmen"}

Name: Anonymous 2009-04-02 5:32

LET A @LEGS \EING
10 IF A < 1
     END
   END IF
WUNT \AUSG "SUSSMAN\n"
LET A A-1
GOTO 10

Name: Anonymous 2009-04-02 6:12

bits 32
cpu 586
global _main
extern _scanf
extern _puts

section .rodata
format: db "%d",0
string: db "Sussman",0

section .text
_main:
    enter 8,0
    mov dword [esp],format
    lea eax,[esp+4]
    mov [eax],eax
    call _scanf
    cmp eax,1
    jnz .end
    mov esi,[esp+4]
    cmp esi,1
    jl .end
    mov dword [esp],string
.loop:
    call _puts
    dec esi
    jnz .loop
.end:
    xor eax,eax
    leave
    ret

Name: Anonymous 2009-04-02 6:50

(define (print-suss n)
  (if (< n 1)
      #t
      (and (display "sussman\n")
           (print-suss (- n 1)))))

Name: Anonymous 2009-04-02 7:04

>>28
Only meets half the requirements.  You have brought shame upon our humble thread.

Name: Anonymous 2009-04-02 7:08

>>28
Fuck, I just typed the same thing. Except mine used (display "Sussman") and (newline), and called the procedure print-sussman.

Name: Anonymous 2009-04-02 7:20

>>29
User input has been left as an exercise to the reader

Name: Anonymous 2009-04-02 7:23

>>29
if you insist
(print-suss (read))

Name: Anonymous 2009-04-02 8:14

Ladies and Gentlemen of /prog/,
I give you Sussman.bf. If you want a number larger than 9 you will need to use the correct ASCII character.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
++++++++++>
,------------------------------------------------
[<<<<<<<<.>.>.>.>.>.>.>.>-]

Name: Anonymous 2009-04-02 9:16

>>33
Holy sheepshit, please optimize that.

Name: Anonymous 2009-04-02 9:23

>>34
RICER DETECTED

Name: Anonymous 2009-04-03 9:42

yes "Sussman" | head -n 666
Replace 666 by the desired amount of Sussmen

Name: Anonymous 2009-04-03 11:07

>>36
Take a number from the standard input

Name: Anonymous 2009-04-03 11:08

>>33
ZOMG OPTIMIZED
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>
,------------------------------------------------
[<.++++++++++++++++++++++++++++++++++.--..------.------------.+++++++++++++.----------------------------------------------------------------------------------------------------.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>-]

Name: Anonymous 2009-04-03 11:23

ABC needs I/O operations.

Name: Anonymous 2009-04-03 11:29

>>37
Left as an exercise to the reader.

Name: Anonymous 2009-04-03 12:00

>>36-37,40
n=`cat`; yes "Sussman" | head -n $n

Name: Anonymous 2009-04-03 12:13

what

Name: Anonymous 2009-04-03 12:17

>>41
EXPERT READER

Name: Anonymous 2009-04-03 14:33

>>41
n=`cat`; yes "Sussman" | head -n $n | tr -d '\n'

Name: Anonymous 2009-04-03 15:57

chris@chrislaptop ~> n=`cat`; yes "Sussman" | head -n $n | tr -d '\n' 
fish: Unknown command “n=`cat`”. Did you mean “set n `cat`”? For information on
assigning values to variables, see the help section on the set command by typing
“help set”.
head: option requires an argument -- n
usage: head [-n lines | -c bytes] [file ...]

Name: Anonymous 2009-04-03 16:03

>>45
Maybe you should use a real shell instead of pretending the failings of your toy setup are our problem.

Name: Anonymous 2009-04-03 16:50

I paid $5000 for my Mac. For all intents and purposes, your setup can only be a ``toy'' compared to mine.

Name: Anonymous 2009-04-03 17:02

>>47
You mean for all intense and porpoises

Name: Anonymous 2009-04-03 17:20

>>47
The fact that it's an expensive toy doesn't make it not a toy. It just makes you a spoiled brat.

Name: Anonymous 2009-04-03 17:29

read n;yes "Sussman"|head -n$n

Name: Anonymous 2009-04-03 17:36

C:\> read n;yes "Sussman"|head -n$n
Bad command or filename - "read".
Bad command or filename - "head".

C:\>

Name: Anonymous 2009-04-03 17:38

(defun sussman (n)
  (if (> n 0)
    (progn
      (format t "Sussman~%")
      (sussman (1- n)))))

(sussman (coerce (read) 'number))

Name: Anonymous 2010-11-14 17:40

Name: Anonymous 2011-01-31 20:49

<-- check em dubz

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