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

Pages: 1-

How do you do this?

Name: Anonymous 2013-01-28 0:59

/prog/ How do you do this?

Write the function mult-table which consumes two natural numbers nr and nc, and produces a list of nr lists, each of which contains nc natural numbers. The cth entry of the rth list (where we start numbering at 0) in the produced list should be r*c.
For example,
     (mult-table 2 3) => (list (list 0 0 0) (list 0 1 2))
and
     (mult-table 3 4) =>
        (list (list 0 0 0 0)
              (list 0 1 2 3)
(list 0 2 4 6)).

Hint: use build-list twice. The first time, try to make a list containing nr elements. Then, for each of these elements, make a list of nc elements. You may use other abstract list functions as well.

Name: Anonymous 2013-01-28 1:02

Do your own homework.

Name: Anonymous 2013-01-28 1:03

>>2
Scheme is shit...
Just waiting till February to just start python. Fuck this pathetic language.

Name: Anonymous 2013-01-28 1:06

>>3
Dumbass fuckin' goyim, get off my lawn.

Name: Anonymous 2013-01-28 1:09

>>4
No.

Name: Anonymous 2013-01-28 2:36

>>3
Spoken like a true ENTERPRISE code monkey.

Name: Anonymous 2013-01-28 2:55

>>6
Spoken like a true FAGGOT.

Name: Anonymous 2013-01-28 2:56

Here's my solution.

(define (mult-table nr nc)
  (define (iter-table r)
    (define (iter-row c)
      (if (< c nc)
        (cons (* r c)
              (iter-row (+ c 1)))
        '()))
    (if (< r nr)
      (cons (iter-row 0)
            (iter-table (+ r 1)))
      '()))
  (iter-table 0))


Of course, this doesn't use the build-list procedure you're supposed to use, because you provide it, so you probably won't get full credit.

What school are you attending that teaches Scheme?

Name: Anonymous 2013-01-28 2:58

>>8
Sarah Lawrence College

Name: Anonymous 2013-01-28 3:07

Solution in OCaml:
let generate_list x y =
      let rec aux pas init indice =
          if indice = y then []
          else init::(aux pas (init + pas) (indice + 1))
      in aux x 0 0 ;;
let multtable x y =
      let rec aux indice = if indice = x then []
          else (generate_list indice y)::(aux (indice + 1))
      in aux 0 ;;

Name: Anonymous 2013-01-28 4:18

>>10
More like let, amiright?

Name: Anonymous 2013-01-28 7:44

>>11
It's funny because I'm french.

Name: Anonymous 2013-01-28 10:25

>>12
Go back to Reddit, Yannick.

Name: Anonymous 2013-01-28 11:47

>>13
va le fair enculer connard anglo

Name: Anonymous 2013-01-28 11:48

>>14
va le fairy face enculer franco coward

Name: Anonymous 2013-01-28 11:52

>>15
FUCK YOU I HATE YOU CONNARD ENCULER

Name: Anonymous 2013-01-28 12:08

>>14,16
not valid french, cretin, fuck off and die in a fire

Name: Anonymous 2013-01-28 12:22

>>17
Fuck off, Le Jacques Yannick Snaile.

Name: Anonymous 2013-01-28 12:36

>>18
va te faire enculer, connard de merde, meurs dans un feu

Name: Anonymous 2013-01-28 12:42

>>19
va le fairy enculer. coward de merde, murrs le feu face

Name: Anonymous 2013-01-28 13:02

Does anyone actually know how to do this?

Name: Anonymous 2013-01-28 13:04

>>21
Yes, but they will take at least 5 days to answer. For the moment being, enjoy the French guy.

Name: Anonymous 2013-01-28 13:06

>>3
Good luck, you just threw away any chance of getting a /prog/rider to help you.

Now fuck off and do your homework, FIOCista.

Name: Anonymous 2013-01-28 13:53

>>20
LE ENCULER VA LE FAIRE DANS LE CONNARD ANGLO LE MEURS DANS LE ENCULER LE FEU DE MERDE
VA MEURS CONNARD ANGLO TE ENCULER DE MERDE LE MEURS

Name: Anonymous 2013-01-28 14:51

>>19
For some reason, French doesn't sound insulting at all.

Name: Anonymous 2013-01-28 16:12

>>21
see
>>8

Name: Anonymous 2013-01-28 18:08

>>20,24
go fucking yourself you imitating piece of shit die in a fire FUCK YOU I FUCKING HATE YOU FAGGOT DIE

Name: Anonymous 2013-01-28 18:11

>>27
va le reddit fairy enculer, franco coward

Name: Anonymous 2013-01-28 18:13

>>28
FUCK YOU LEL-CRETIN DIE IN A FIRE

Name: Anonymous 2013-01-28 18:14

>>27
go fucking fuck yourself you LEL-CUNT

Name: Anonymous 2013-01-28 18:34

Stop having fun with the french idiot, he is MY toy, I found him first!

Name: Anonymous 2013-01-28 18:36

>>31
I'm not an idiot, and fuck off and die, ????????????????????????.

Name: Anonymous 2013-01-28 18:37

>>32
I only see squares. Fucking Fireshit can't even use fallback fonts for this?

Also you're a LEl-cunt, Mr. Reddit.

Name: Anonymous 2013-01-28 18:41

let multTable nr nc = [[r * c | r <- [0..nc-1]] | c <- [0..nr-1]]

Name: Anonymous 2013-01-28 18:43

>>32
uhuh. LE french idiot

Name: Anonymous 2013-01-28 18:45

>>33
fuck off and die in a fire lel-cunt I fucking hate you

Name: Anonymous 2013-01-28 18:57

>>36
lel ^^ =D

Name: Anonymous 2013-01-28 20:16

>>27 this thread is terrible

so terrible

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