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

do my homework for me

Name: Anonymous 2012-10-02 17:08

i need a program that finds all the primes under an arbitrary number and puts them on the console

have it ready by thursday at noon you faggots

Name: Anonymous 2013-05-30 1:44

I like >>1's honesty.

Name: Anonymous 2013-05-30 2:01

Here you are OP. Hope you turn it in on time.

(define (stream-filter pred? stream)
  (cond ((null? stream) '())
        ((pred? (car stream))
         (cons (car stream) (delay (stream-filter pred? (force (cdr stream))))))
        (else (stream-filter pred? (force (cdr stream))))))

(define (range-stream from to)
  (if (> from to)
    '()
    (cons from (delay (range-stream (+ from 1) to)))))

(define (prime-stream to)
  (let iter ((stream (range-stream 2 to)))
    (if (null? stream)
      '()
      (cons (car stream)
            (iter (stream-filter (lambda (x)
                                   (not (zero? (remainder x (car stream)))))
                                 (force (cdr stream))))))))

(let iter ((stream (prime-stream 1000))) ; change 1000 to whatever arbitrary number you like
  (if (not (null? stream))
    (begin
      (display (car stream))
      (newline)
      (iter (force (cdr stream))))))

Name: Anonymous 2013-05-30 2:34

DTIHDE HIEM AGGOE RBEADCDKI TTSO?

Name: Anonymous 2013-05-30 2:35

Just use Eurothenes(or however it's spelt) sieve, you must know at least basic maths? This is so simple any faggot could do it.

Name: Anonymous 2013-05-30 2:40

>>84
Sounds Jewish. I can't trust it to not output a composite or fraction or something just to fuck me over.

Name: Anonymous 2013-05-30 3:20

>>1,14,18,24,29,57
I FUCKING love this guy!

>>83
I hope not.

Name: Anonymous 2013-05-30 4:55

I wrote this in 2010. I thought it was top shit.

Trigger Warning: Windows
format PE Console 4.0
include 'win32a.inc'
entry main

section '.text' code data readable writeable executable
sieve:
  cmp dword[esp+8],1
  jle .ret
  push esi
  push edi
  mov esi,[esp+0xC]  ;ESI = buffer
  mov edi,[esp+0x10] ;size
  push ebx

  lea ecx,[edi-2]    ;ECX = size - 2
  mov ebx,2          ;EBX = p
  push edi
  push edi
  fnstcw [esp]
  fnstcw [esp+2]
  wait
  or byte[esp+1],0xC
  fldcw [esp]
  fild dword[esp+4]
  fsqrt
  fistp dword[esp+4]
  fldcw [esp+2]
  pop edi
  pop edi             ;EDI = upto

  push edi
  push ecx
  mov word[esi],0
  mov al,1
  lea edi,[esi+2]
  rep stosb
  pop ecx
  pop edi

  add esi,ebx
  db 0x66,0x90
  .loop:
    cmp byte[esi],0
    jnz .Prime
   .cond:
    inc ebx
    inc esi
    dec ecx
    cmp ebx,edi
    jl .loop
    jmp @f

    .Prime:
      mov eax,ebx
      imul eax,eax
      sub eax,ebx
      .SetToNonPrime:
        mov byte[esi+eax],0
        add eax,ebx
        cmp eax,ecx
        jl .SetToNonPrime
      jmp .cond
  @@:
  pop ebx
  pop edi
  pop esi
.ret:
  retn 8

main:
  push getnum_printstr
  call [printf]
  push esp
  push getnum_scanstr
  call [scanf]
  add esp,8
  inc dword[esp]
  push edi
  push dword[esp+4]
  call [malloc]
  mov edi,eax
  push eax
  call sieve
  push ebx
  push esi
    mov ebx,[esp+0xC]
    mov esi,2
    sub ebx,esi
    push esi
    push numstr
    @@:
      cmp byte[esi+edi],0
      je .NotPrime
        call [printf]
      .NotPrime:
      inc esi
      mov [esp+4],esi
      dec ebx
      jnz @b
    pop eax
    pop eax
  pop esi
  pop ebx
  push edi
  call [free]
  pop edi
  call [getch]
  pop edi
  pop ecx
  ret

align 4
data import
  library crt,'MSVCRT.DLL'
  import  crt,getch,'_getch',free,'free',malloc,'malloc',printf,'printf',scanf,'scanf'
end data
numstr db '%u',9,0
getnum_printstr db 'Find up to which number? ',0
getnum_scanstr db '%u',0

Name: Anonymous 2013-05-30 5:07

>>86
LELLLLLLLELLELELELLELELEELELLELELELELELLELEL
HES SOOOOOOO ED/G/Y XDDDDDDDDDDDDDDDDD
I WANNA SUCK HE BI/G/ /G/IANT ED/G/Y /G/ONADSSS XDDDDDDDDDDDD
I WISH I CUD BE AS ED/G/Y AS HIM
SO DREAM LELLLLELLELELELLELELELELELLELEELELELELEL
>E/G/IN

Name: Anonymous 2013-05-30 9:18

>>88
fuck off

Name: Anonymous 2013-05-30 12:40

>>87
x86 filth
Cudder, forgot tripcode?

Name: Anonymous 2013-05-30 12:54

>>85 lel, it's greek, long before any Jews, so I think we're safe. Unless Zeus worshippers happen to be just as bad.

Name: Anonymous 2013-05-30 15:40

>>91
Greeks are all pederast, which is a symptom of being jews.

Name: Anonymous 2013-05-30 15:54

It's true, I'm jewish and a pedo. Everyone on the jewish side of my family is pedo too.

Name: Anonymous 2013-05-30 16:34

>>91
http://en.wikipedia.org/wiki/Greek_alphabet
Parent systems Phoenician alphabet

http://en.wikipedia.org/wiki/Phoenician_language
Phoenician is a Semitic language
Shalom!

Name: Anonymous 2013-05-30 16:50

(define (prime? n) (= 2 (length (factorize n))))
(define (primes n) (upto n (lambda (k) (when (prime? k) (print k)))))

Name: Anonymous 2013-05-30 17:33

>>9
The most widely spoken Semitic languages today are ARABIC[1] (206 million native speakers),[2] Amharic (27 million),[3][4] Hebrew (about 7 million),[5] Tigrinya (6.7 million),[6] and Aramaic (about 2.2 million).

Salam, raghead! Salam, raghead! AheeeeeeKILLTHEKIKESALAILALALALLAHBOOOOOOOOOOOOOOOOOOOM

Name: >>96 2013-05-30 17:42

I meant >>94, obviously. But he already bombed his nigger ass in the name of the Nigger God, so it's not like he's alive or something.

Name: Anonymous 2013-05-30 18:12

So this is where `fat nuggets' came from....

Name: Anonymous 2013-05-30 18:16

>>98
Yes, >>70 was my post indeed.

Name: Anonymous 2013-05-30 18:23

>>98
I don't know how he came up with it, but to me it'll always be from this guro that I saw on /b/ in, like, 2005, where this girl had her skin removed and was raped and tortured while the guy was taunting her, then he used a waffle iron to eat the fat. It scarred me for life, and the phrase still disturbs me.

Name: Anonymous 2013-05-30 18:50

>>70
JEWYUKO

Name: Anonymous 2013-05-30 18:51

>>100
R.I.P. in peace /g/ - Guro, the original and only good /g/ ;_;

Name: Anonymous 2013-05-30 18:52

>>100
wow nerd 2005!? get a life

Name: Anonymous 2013-05-30 19:28

>>100
So that's the reason you don't like `my' term!

I `came up' with it because I saw someone on /jp/ using it. It is accurate enough, as perfect breasts are precisely that, nugget-sized fat balls. I know "nugget-sized" is unscientific and mostly subjective, so here's a sample:
http://i.imgur.com/AfuAZ6c.png
That size or something a tad smaller is perfect.

Also, I'm sorry to hear about your story, though. I only saw real gore in the old /b/.

Name: Anonymous 2013-05-30 19:30

>>101
No wonder she spends so much time with JEWKARI the conspiring youkikekai

Name: Anonymous 2013-05-30 19:34

>>100
So guro made you a pedophile?

Name: Anonymous 2013-05-30 19:49

>>104
Also ... though
I don't think this is grammatical. Sorry, scarred-for-life-kun, I promise I'll proofread all my posts from now on.

Name: Anonymous 2013-05-31 1:25

>>104
That image got me fired.

Name: Anonymous 2013-05-31 1:39

>>108
It's 1 in the morning, what the fuck are you doing at work? Are you some sort of shitskin or subhuman Russian?

Name: Anonymous 2013-05-31 2:22

>>110
apparently everyone lives in the same timezone
>>111
nice trips bro

Name: Anonymous 2013-05-31 2:32

>>111
Thanks bro.

Name: Anonymous 2013-05-31 3:00

>>110
Everyone important does.

Name: Anonymous 2013-05-31 3:20

Terrible[i]![/i]
Terrible[i]![/i]
Terrible[i]![/i]
Terrible[i]![/i]
Terrible[i]![/i]
Terrible[i]![/i]
Terrible[i]![/i]

Name: Anonymous 2013-05-31 16:40


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