Sign in to follow this  
Rubrica

The Sanctuary

Recommended Posts

Yay congratulations!! :D

Thanks! This is indeed a much better day now. I'm going to make myself a sandwich, and maybe a :bmw:.

Share this post


Link to post
Share on other sites
My 360 RRoD'ed...

Get a Ps3 :lol:

Hey! This is the Sanctuary - no baiting fanboy wars in the Sanctuary. :P

On that note, a friend of mine is now on his fourth PS3. His first one lasted a couple years, then it got the Yellow-Light-of-Death. He sent it out for service, got back a completely different PS3, and that one lasted for about two weeks. Furious, he sent that one back, got a third one from Sony - dead out of the box.

Don't get me wrong, I'm a Sony fanboy if anything, and I'd take the PS3 over the 360 any day, but the infallible PS3 myth is just as much a myth as Apple's "It just works" mantra.

Happiness:

I don't really have one right now, I'm just responding to things. ;)

Share this post


Link to post
Share on other sites

Wan't meant as fanboy bait. Just a joke.

My PS3 YLODed after almost 2 years. But it was within warranty so I got a new one and it's still going.

topic>

Edit: Btw I love your sig. MGS pun amirite?

Share this post


Link to post
Share on other sites
Wan't meant as fanboy bait. Just a joke.

I got that from your :lol: , just like my :wink: meant I wasn't wholly serious either. But you know how sensitive fanboys are, so I had to jump in there. ;)

Edit: Btw I love your sig. MGS pun amirite?

Yep. It's a take off of the Subsistence disc of the Metal Gear Solid Essential Collection. Thanks. :)

Share this post


Link to post
Share on other sites
Yep. It's a take off of the Subsistence disc of the Metal Gear Solid Essential Collection. Thanks. :)

It's a shame they didn't release it over the pond, but then again copies of MGS 2 and 3 aren't impossible to find :)

Share this post


Link to post
Share on other sites

F# is cool!

open System
open System.Diagnostics

let rec primeFactors x =
   let mutable i = uint64 (float x**0.5)
   while x%i0uL&&i>2uL do
       i    if i>1uL&&x%i=0uL then (primeFactors i) @ (primeFactors (x/i))
   else [x]

let toHistogram (x:uint64 list) = 
   let arr = Array.zeroCreate (int (List.max(x))+1)
   for i in x do
       arr.[int i]    arr

let toSingle (x:int array) = 
   let mutable v = 1.0
   for i = 0 to x.Length - 1 do 
       v    v

let input = UInt64.Parse(Console.ReadLine())
let stopwatch = new Stopwatch();
stopwatch.Start();

let finalfactors:int array = Array.zeroCreate(int(input)+1);
for divisor in int 2..int input do
   let factors =
       divisor
       |>uint64
       |>primeFactors
       |>toHistogram
   for i = 0 to factors.Length - 1 do
       finalfactors.[i]int)
let value = 
   finalfactors
   |>toSingle

stopwatch.Stop();
printfn "got %A" value
printfn "in %A ms" stopwatch.ElapsedMilliseconds

Console.ReadKey()|>ignore

Share this post


Link to post
Share on other sites

@Pyrochild: That seems interesting. Makes me want to know what it does (is it a stopwatch?)

---

I'm getting a Nikon D60. :)

Share this post


Link to post
Share on other sites
I'm happy because I'm up at 3:15AM doing nothing.

Posting in the prestigious PDN forums is more than nothing good sir. ;P

And Kemaru, I envy you ¬_¬ I need to get a DSLR sometime...

Share this post


Link to post
Share on other sites
@Pyrochild: That seems interesting. Makes me want to know what it does (is it a stopwatch?)

No, it calculates the least common multiple of the integers from 1 to whatever you specify. For example, 2520 is the smallest number that can be divided by each of the numbers from 1 to 10. The stopwatch is to test the speed of it.

I wrote it for Project Euler, which is by far the best way to learn a functional programing language.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this