LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Prime Factor Coding Challenge

For those of you still watching this thread, here's a treat:

NI is working on an official posting of the results of this challenge.  It took longer than expected for several reasons.  It should appear shortly.

We are also working on the next challenge.  It looks like it will be playing 4x4 tic tac toe.  Each entry will play one side of the game, and all the entries will play all the others, once as X and once as O.  The most points (win=2, draw=1) wins.  Does this sound like an interesting challenge?

Bruce

Bruce Ammons
Ammons Engineering
Message 171 of 186
(2,720 Views)

@Bruce Ammons wrote:

Does this sound like an interesting challenge?


Yes, and rooted more in good algorithm design and less in finding the most efficient math algorithm, so I might just take a shot at it if I have the time.

___________________
Try to take over the world!
Message 172 of 186
(2,696 Views)

The tic tac toe challenge was just posted today.  We are playing on a 4x4 grid, and the goal is to LOSE the game by forcing your opponent to win.  It should be interesting.  Look for the new discussion thread to go with it.

Bruce

Bruce Ammons
Ammons Engineering
Message 173 of 186
(2,639 Views)


@Bruce Ammons wrote:

The tic tac toe challenge was just posted today.  We are playing on a 4x4 grid, and the goal is to LOSE the game by forcing your opponent to win.  It should be interesting.  Look for the new discussion thread to go with it.

Bruce




Sounds neat, but the link to the new challenge on the labview zone page still points to the old prime factor challenge. Am I missing something?

Ok, nevermind - just got fixed.

Message Edited by bsquared on 04-27-2006 07:53 AM

0 Kudos
Message 174 of 186
(2,616 Views)
I realize this thread has been "dead" for quite a while, but didn't know where best to post it.  Directed towards shoneill, would you be willing to post or send me your trial division entry to this challenge, if you still have it available?  I was noodling around with factoring code (specifically, cache efficient sieving) again recently, and wanted to take a look at it.  Thanks!
 
- ben.
0 Kudos
Message 175 of 186
(2,408 Views)
I'll post it tomorrow when I'm back in work.

For some reason I don't seem to have a copy on my home machine.  Probably something to do with my system re-install a while back.

It's not really anything super (compared to the winning entry!), but I'll post anyway.

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 176 of 186
(2,397 Views)
Here it is.

I believe this was my final entry.

The sieve is terribly (not at all) commented, but the first part is a sieve on a boolean array representing ODD numbers only.

The second part of the prime generation simply reconstructs a proper U32 array or prime numbers resulting from the first part.

The code was written in LV 6.1.

Have fun

Shane
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Message 177 of 186
(2,378 Views)

Thanks Shane!

There are some clever things in there that will take me awhile to digest, but I think I understand the general approach.  Very nice.

I'm working on a version which implements a cache blocking approach to sieving.  I've gotten this to work in C, and wondered if I could do the same in labview.  I'll post the result if I get it to work.

thanks again,

- ben.

0 Kudos
Message 178 of 186
(2,351 Views)

For your entertainment, here's one of my simpler versions (LabVIEW 7.1). I think it produces correct results. In spirit, it's pretty similar to Shane's. 🙂

Sieve on the left, trial division on the right. (Sieve runs only once, then caches prime array in shift register).

Message Edited by altenbach on 01-23-2007 09:40 AM

Message Edited by altenbach on 01-23-2007 09:45 AM

Download All
Message 179 of 186
(2,343 Views)

For anyone that's interested, here's a different version of the sieve.  No, I haven't been working on it since '05 Smiley Wink, but it seems to be pretty fast, so I wish I did it back when the challenge was going on Smiley Tongue

I only recently learned about the technique I used (in a C program I've been developing), and wondered how it would work implemented in labview.  Enjoy. 

- ben.

Message 180 of 186
(2,305 Views)