3 Replies - 1165 Views - Last Post: 27 February 2012 - 09:18 AM

#1 Braber01  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 247
  • Joined: 29-November 08

F# TEST runs fine on Linux partion but Gets CE on SPOJ

Posted 26 February 2012 - 06:31 PM

This program runs fine on my machine, however the SPOJ judge thinks there's something wrong with it? could It be that I'm Mixing #light and verbose syntax?

anyway here's my code
open System
let mutable count = 0 //Loop Counter
let mutable hasAnswer = false // has 42 been entered yet?

while count < 5 do
    let input = Console.ReadLine()
    let intInput = Convert.ToInt32(input)
    match intInput with
    | _ when hasAnswer = true -> () //Don't Print Anything
    | 42 -> hasAnswer <- true //42 is the answer to life
    | _ -> Console.WriteLine(intInput.ToString())
    count <- count + 1 //increase the loop counter
done //this makes it cleaner to me to those of you who don't like python, the no ending block is what did it for me.



Is This A Good Question/Topic? 0
  • +

Replies To: F# TEST runs fine on Linux partion but Gets CE on SPOJ

#2 sepp2k  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2086
  • Posts: 3,173
  • Joined: 21-June 11

Re: F# TEST runs fine on Linux partion but Gets CE on SPOJ

Posted 27 February 2012 - 12:10 AM

Are you sure you're getting a compile error for that code? If I copy and paste your code into SPOJ, it compiles fine for me.
Was This Post Helpful? 0
  • +
  • -

#3 Braber01  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 247
  • Joined: 29-November 08

Re: F# TEST runs fine on Linux partion but Gets CE on SPOJ

Posted 27 February 2012 - 09:12 AM

Huh... I must of submitted it under the worng language...
Was This Post Helpful? 0
  • +
  • -

#4 Braber01  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 247
  • Joined: 29-November 08

Re: F# TEST runs fine on Linux partion but Gets CE on SPOJ

Posted 27 February 2012 - 09:18 AM

SPOJ must be something ... Idon't know, I sumbited this solution last night and it Gave me a CE and now it's fine... *goes to look up List Methods...*
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1