Coder Profile - Show off your skills, get a coder profile.
 
 
 
The Author
Cinjection
Oleksi Derkatch
Send A Message
Rating
8.00
out of 10
( 1 Ratings )
Please login to rate source codes.

Click here to register a free account with us.
General Details
Scheme
Posted 131 Days Ago
278 Views
Received 1 Rating
More Codes By This Author
MD5 Brute-Forcer
Number of ways to make ch...
SPS Desktop Changer
Simple program using GUI...
Genetic Algorithm for sol...
Articles By This Author
Intorduction to memoizati...
Strings in C++
Vectors in C++
Use Cases
[C++] Pointers and their...

Factoring numbers


Description
Here's a little program I made the factors a number into it's lowest prime factors. For example, factoring 100 gives use 2 * 2 * 5 * 5.
Source Code
Comments
Please login to post comments.
 
Cinjection     Posted 126 Days Ago
 
 
No no. It's a full language. Quite a good one too. It's small, simple, and
can be very powerful.
 
Izzmo     Posted 126 Days Ago
 
 
Is Scheme actually a language with you can program, or is it a pseudo-language?
I've never really looked into it.
 
Cinjection     Posted 130 Days Ago
 
 
The algorithm itself is very simple. The only thing that might confuse you is the
Scheme syntax (especially if you've never used the language before).

The algorithm is simple:
def factor(num)

if num.is_prime?
num
else
make-a-list-with ( lowest-prime-divisor and (factor (num /
lowest-prime-divisor) ) )
end

end

That's all there is too it. The Scheme code adds some cool things (like
I'm actually returning a function, whos state contains a sieve of prime
numbers).
 
Izzmo     Posted 131 Days Ago
 
 
That's very cool.. but totally foreign to me, lol! I don't even know if I
can reproduce this in C#.. it would really take some time for to sit and think about
it...
Page 1 of 1
More "Scheme" Source Codes By This Author
Recently Posted "Scheme" Source Codes
Recently Rated "Scheme" Source Codes
 
 
Latest News About Coder Profile
Coder Profile Poll
How often do you write code on average per week?

< 5 hours
5 to 20 hours
21 to 30 hours
31 to 40 hours
> 40 hours


please login to cast your vote
and see the results of this poll
Latest Coder Profile Changes
Coder Profile was last updated
5 Days Ago
Official Blog :: Make A Donation :: Credits :: Contact Me
Terms & Conditions :: Privacy Policy :: Documents :: Wallpapers
Version 1.46.00
Copyright © 2007 - 2008, Scott Thompson, All Rights Reserved