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

Pages: 1-4041-8081-

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 2012-10-02 17:09

fuck off!

Name: Anonymous 2012-10-02 17:09

if you need help at least ask nicely you lazy twat!

Name: Anonymous 2012-10-02 17:12

Why are you using puts?

Name: Anonymous 2012-10-02 17:19

<a href="C:\My Documents\system32\findprimes.bas">I already did it in my spare time because i am a big nerd! rofl</a>

Name: Anonymous 2012-10-02 17:53


(defun find-primes (n)
  ;left as an exercise for the OP
  )

(find-primes n)

Name: Anonymous 2012-10-02 18:19

You surely remember 3.5.2 Infinite Streams.

(define-syntax delay
  (syntax-rules ()
    ((delay expr)
     (lambda ()
       expr))))

(define-syntax cons-stream
  (syntax-rules ()
    ((cons-stream a b)
     (cons a (delay b)))))

(define (force2 x)
  (x))

(define (stream-car s)
  (car s))

(define (stream-cdr s)
  (force2 (cdr s)))

(define (stream-ref s n)
  (if (= n 0)
      (stream-car s)
      (stream-ref (stream-cdr s) (- n 1))))

(define (stream-null? stream) (null? stream))

(define (stream-filter pred stream)
  (cond ((stream-null? stream) the-empty-stream)
        ((pred (stream-car stream))
         (cons-stream (stream-car stream)
                      (stream-filter pred
                                     (stream-cdr stream))))
        (else (stream-filter pred (stream-cdr stream)))))

(define (integers-starting-from n)
  (cons-stream n (integers-starting-from (+ n 1))))

(define (divisible? x y) (= (remainder x y) 0))

(define (sieve stream)
  (cons-stream
   (stream-car stream)
   (sieve (stream-filter
           (lambda (x)
             (not (divisible? x (stream-car stream))))
           (stream-cdr stream)))))

(define primes (sieve (integers-starting-from 2)))

Name: Anonymous 2012-10-02 18:22


/*****************************************
 * Let's pick an arbitrary number,       *
 * because >>1 didn't specify which one! *
 * I think I'll choose ``1".             *
 *****************************************/

int main(void) { return 0; }

Name: Anonymous 2012-10-02 19:08


long long primes[] ={ 2, 3, 5, 7, 11, 13, 17, 23}; // TODO: ADD THE REST OF THE PRIMES HERE
long long num = 8; // number of primes goes here
int main()
{
     int input = 0;
     printf("number:");
     scanf("%d",&input);
     for(int i = 0; i < num; i++)
     {
          if(primes[i] < input)
          {
               printf("%d",primes[i]);
          }
     }
     return 0;
}

Name: Anonymous 2012-10-02 19:10

There's an incredibly obvious, easy to write algorithm for this, and plenty of examples on the internet.

Name: Anonymous 2012-10-02 19:58

import sys
message = "all the primes under an arbitrary number"
sys.out.write(message)
sys.exit()

Name: Anonymous 2012-10-02 20:02

>>7
beat me to it.

Name: Anonymous 2012-10-02 20:39

>>7
lol sicp. truly a loser's book.

Name: Anonymous 2012-10-02 20:47

god damn you people suck. why the fuck do i have to take comp sci if im a business major???

>>10
just do it you fucking unemployable idiot

>>7
no trial division

Name: achooo 2012-10-02 20:53

This is easy. I'll hint, then you give me a biscuit.

Make an array for primes for N/2,
make and integer, i, with a limit max of N,
Continuously increment i, and test that it is not divisible by 2 and it is not 2,
if not, increase i again and repeat loop from start,

save i to an array of i's,
Test in a loop that prime[i] is not divisible by prime[test],
if not, increase i again and repeat loop from start,

print i

Then print, "I am done teach. give me a biscuit."

Name: Anonymous 2012-10-02 20:56

>>14
god damn you people suck. why the fuck do i have to take comp sci if im a business major???
So the JEWS can get your tuition and use it to let niggers and illegal, unwashed mexicans in for free.

Name: Anonymous 2012-10-02 21:01

>>14
Now you should really quit while you can. I am >>15-kun, And that statement is like say,

"Why do I have to sign things, when all I want to do is own the fucking place?"

Business major is programming revenue, dipshit. If you cannot get simple algorithms, you will never make it past the next month of any you start.

Get a math theory book, and get started, or I will smash personally

Name: Anonymous 2012-10-02 21:03

>>17
i don't care about computers or math. my family already owns a company i just want the degree :)

Name: Anonymous 2012-10-02 21:05

>>18
you are so retarded, that you can't write such a simple algorithm? kill yourself please.

Name: Anonymous 2012-10-02 21:10

>>19
fuck you

Name: Anonymous 2012-10-02 21:10

>>1
so easy even a child, nay, even a woman could do it.

Name: Anonymous 2012-10-02 21:13

So easy, even leah culver could do it. take that, `bussiness major'!

Name: Anonymous 2012-10-02 21:16

>>21
NICE

OP, for the sakes the rest of your life, either kill yourself, or go to the art department. You do not deserve the degree with that mentality. Or even your computer.

Name: Anonymous 2012-10-02 21:24

>>23
i'm not a fucking faggot art student and im not about to hang out with faggots who obsesses over the size of a cock in some abstract bullshit and thinks it means the stuggle of man to fight the cops or or some equally retarded

and BA is way worse than a BS

Name: Anonymous 2012-10-02 21:27

Sure, it's easy, but is it Abelson easy?

Name: Anonymous 2012-10-02 21:30

>>24
No wonder you can't program, you can barely even speak English. Might be best to drop out and stick with manual labor.

Name: Anonymous 2012-10-02 21:33

>>24
I love it when you fall in your trap. See you in art class. I would love to see your Dark Oppressive art.

Name: Anonymous 2012-10-02 21:36

>>14
Learn JAVA!

Name: Anonymous 2012-10-02 21:36

>>26
>>27
fuck you both

>>27
but especially fuck you

Name: Anonymous 2012-10-02 21:58

>>29
still can't code this child's algorithm?

Name: Anonymous 2012-10-02 22:01

that was leah culver quality!

Name: Anonymous 2012-10-02 22:02

babby's first algorithm

Name: Anonymous 2012-10-02 22:05

How's your business degree going, Leah?

Name: leah culver 2012-10-02 22:07

I'm printing the hard-coded array [2 3 5 7 ...], but there must be some `mathematical' way of doing it, i just can't remember how.

Name: Leah Culver 2012-10-02 22:12

That seems to me like something people would remember if they had used it before. I’d never had to print prime numbers before and I kept thinking that there was some way to do it mathematically, but I couldn’t remember how. I hope it’s not as important to know the best solution as it is to know a better solution exists.

Name: Anonymous 2012-10-02 22:56

Enjoy fucking Richard Stallman's hairy man boobs while the sweet Leah is rubbing my dick between her white, soft, aryan, valkyriesque mammaries.

Name: Anonymous 2012-10-02 22:58

>>36
Enjoy scraping your dick on those acne scars.

Name: Anonymous 2012-10-02 23:16

>>36
back to /3DPD/, ``please''

Name: Anonymous 2012-10-02 23:25

>>36
enjoy your fantasy.

Name: Anonymous 2012-10-02 23:25

``please"

Name: Anonymous 2012-10-02 23:25

>>38
Fuck off, pedophile.

Name: Anonymous 2012-10-02 23:26

``please''

Name: Anonymous 2012-10-02 23:27

guise, let's get back to helping OP.

Name: Anonymous 2012-10-02 23:31

>>43
I wouldn't like to walk the kilometres of dicks you've sucked.

Name: Anonymous 2012-10-02 23:33

>>44
I remember that thread, as well as the exact post.  Sweet memories.

Name: Anonymous 2012-10-02 23:33

A business major...who can't complete a 5th grade logic exercise

``ISHYGDDT''

Name: Anonymous 2012-10-02 23:35

>>44
kilometres
You go suck a dick.

Name: Anonymous 2012-10-02 23:40

>>47
Americans don't use them and yet they manage to spell ``kilometres'' wrong.

Name: Anonymous 2012-10-02 23:48

>>48
That's how Britishes spell it.

Name: Anonymous 2012-10-02 23:49

>>46
Is there any other kind?

Name: Anonymous 2012-10-02 23:57

>>8
AHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA

Name: Anonymous 2012-10-03 1:54

>>15
apple???script???//??????

Name: Anonymous 2012-10-03 2:36

where's my fucking homework?

Name: Anonymous 2012-10-03 2:39

>>53
In your anus. Enjoy your ``incomplete'' on Thursday, faggot.

Name: Anonymous 2012-10-03 3:14

>>53

>>7 is far from efficient but it works. You didn't need ``infinite'' streams for your homework, but it's interesting and fun. The code is from SICP and I eeven took the pain to include the needed macros and redefinitions to make it works in any R5RS Scheme. As is, it will give you the nth prime:


(define primes (sieve (integers-starting-from 2)))
(stream-ref primes 50)

233 ; the 50th prime


Add one line and your problem is solved. It's nothing more than the good old sieve of Eratosthenes (third century BC).

Name: Anonymous 2012-10-03 14:26

Don't help him!

Name: Anonymous 2012-10-04 3:33

i got an extention till next week so you fucksticks an had more time

clock is ticking boys

Name: Here is how 2012-10-04 4:02

Name: Anonymous 2012-10-04 9:39

Name: Anonymous 2012-10-04 13:51

>>1-kun, which Touhou would you fuck?

>>59
Cowtits are not canon. Flat is canon.

Name: Anonymous 2012-10-04 14:04

>>60
flat is pedo.

Name: Anonymous 2012-10-04 14:05

>>61,61,61,61
Are you gay?

Name: Anonymous 2012-10-04 14:07

weeaboo = pedophile same

Name: Anonymous 2012-10-04 14:12

>>62
That's deflecting the issue. You should consider turning yourself in to the authorities.

Name: Anonymous 2012-10-04 14:22

Sure, they are pedophiles, but are they GNU/pedophiles?

Name: Anonymous 2012-10-04 14:22

>>64
You're probably considering sucking my dick, you disgusting Oppai faggot.

Name: Anonymous 2012-10-04 14:28

>>66
Who would suck a pædo? Oh, that's right, the children you rape.

Name: Anonymous 2012-10-04 14:34

>>67
Who would kill a pædo? Oh, that's right, a lot of people.

Name: Anonymous 2012-10-04 14:35

>>67
You are trying my patience. Just go back to tittysluts or wherever the fuck you come from and leave the Touhou out of this, or I'll see to it that you regret it. I have many friends in #4chan IRC.

Name: Anonymous 2012-10-04 15:24

>>61
Flat might be pedo, but small fat nuggets (98.958% of Touhous) can't be pedo.

Yuyuko is like one million centuries old.

Name: Anonymous 2012-10-04 16:43

>>70
I know a woman with a flat chest who is over 40 years old.

Name: Anonymous 2012-10-04 17:23

>>71
lol u le pedo! XD

Name: Anonymous 2012-10-04 17:42

Status update, OP?

Name: Anonymous 2012-10-04 17:53

>>73
He's at a frat party right now and won't be available for a few days. Perhaps we should hurry and get it done before he gets back, or he might give us wedgies!

Name: Anonymous 2012-10-04 18:04

>>74
and le swirly.

Name: Mystia Lorelei 2012-10-04 18:11

>>70
small fat nuggets
S-s-stop calling them like that! I'm not a chicken, stupid!

Name: Anonymous 2012-10-04 18:13

>>76
Would Mystia eat her own eggs?

Name: Anonymous 2012-10-04 18:39

>>76
How should I call them then? They're that, small bags of fat.

Mystia is a hot chick.

Name: Anonymous 2012-10-28 19:47

I bet >>1 will make a great manager.

Name: Anonymous 2012-10-28 23:17

Now I'm getting horny to the thought of fried night sparrows

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


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