PHP Challenge - Morse Code Translator

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

33 Replies - 28463 Views - Last Post: 16 June 2012 - 03:13 AM

#16 codeprada  Icon User is offline

  • Changed Man With Different Priorities
  • member icon

Reputation: 946
  • View blog
  • Posts: 2,355
  • Joined: 15-February 11

Re: PHP Challenge - Morse Code Translator

Posted 13 April 2012 - 08:01 PM

Thanks to all the participants. Deadline date has passed so this challenge is officially over but anyone's welcomed to try it and submit their code just for the practice.
Was This Post Helpful? 2
  • +
  • -

#17 CTphpnwb  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2913
  • View blog
  • Posts: 10,088
  • Joined: 08-August 08

Re: PHP Challenge - Morse Code Translator

Posted 16 April 2012 - 09:28 AM

Are the entries going to be posted soon?
Was This Post Helpful? 0
  • +
  • -

#18 codeprada  Icon User is offline

  • Changed Man With Different Priorities
  • member icon

Reputation: 946
  • View blog
  • Posts: 2,355
  • Joined: 15-February 11

Re: PHP Challenge - Morse Code Translator

Posted 16 April 2012 - 09:59 AM

Yep... by the end of the day. Would of been sooner but I had a busy weekend and now the flu <_<
Was This Post Helpful? 0
  • +
  • -

#19 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3716
  • View blog
  • Posts: 5,976
  • Joined: 08-June 10

Re: PHP Challenge - Morse Code Translator

Posted 17 April 2012 - 09:06 AM

Looks like I'm way too late for this one. Still, just for kicks, here is what I would have submitted.

Spoiler

Not exactly efficient, or in any way practical, but a lot more fun :D
Was This Post Helpful? 0
  • +
  • -

#20 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6053
  • View blog
  • Posts: 23,488
  • Joined: 23-August 08

Re: PHP Challenge - Morse Code Translator

Posted 17 April 2012 - 09:22 AM

I submitted one and failed. Think a regex wasn't quite right. Forgot about it. Oops. It was just for fun anyway :)
Was This Post Helpful? 0
  • +
  • -

#21 codeprada  Icon User is offline

  • Changed Man With Different Priorities
  • member icon

Reputation: 946
  • View blog
  • Posts: 2,355
  • Joined: 15-February 11

Re: PHP Challenge - Morse Code Translator

Posted 17 April 2012 - 09:51 AM

@Atli I'll put it in anyhow.

@JackOfAllTrades It was off by a few characters you know. About 98% accurate :smile2:

This post has been edited by codeprada: 17 April 2012 - 09:53 AM

Was This Post Helpful? 0
  • +
  • -

#22 CTphpnwb  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2913
  • View blog
  • Posts: 10,088
  • Joined: 08-August 08

Re: PHP Challenge - Morse Code Translator

Posted 20 April 2012 - 10:18 AM

Are these posted somewhere?
Was This Post Helpful? 0
  • +
  • -

#23 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2251
  • View blog
  • Posts: 9,435
  • Joined: 29-May 08

Re: PHP Challenge - Morse Code Translator

Posted 20 April 2012 - 01:25 PM

Yes
Was This Post Helpful? 1
  • +
  • -

#24 CTphpnwb  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2913
  • View blog
  • Posts: 10,088
  • Joined: 08-August 08

Re: PHP Challenge - Morse Code Translator

Posted 20 April 2012 - 02:29 PM

Thanks. I could have sworn it wasn't there until you pointed it out!
Was This Post Helpful? 0
  • +
  • -

#25 hiddenghost  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 39
  • View blog
  • Posts: 621
  • Joined: 15-December 09

Re: PHP Challenge - Morse Code Translator

Posted 21 April 2012 - 03:02 AM

Wow. How was the accuracy bad?
I got a 2.5 (50%)for error handling, but all I had was a little trimming for whitespace?
2.5 for readability too? I thought my code was god awful.
Was This Post Helpful? 0
  • +
  • -

#26 sBorg  Icon User is offline

  • New D.I.C Head

Reputation: 5
  • View blog
  • Posts: 28
  • Joined: 24-March 12

Re: PHP Challenge - Morse Code Translator

Posted 21 April 2012 - 06:13 AM

"You also shouldn't output "Invalid Character" in the results or kill the entire script when an invalid character is met."

This wasn't mentioned anywhere *sigh*
Was This Post Helpful? 0
  • +
  • -

#27 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3716
  • View blog
  • Posts: 5,976
  • Joined: 08-June 10

Re: PHP Challenge - Morse Code Translator

Posted 21 April 2012 - 06:29 AM

He's just simulating real-world conditions: "implied" project requirements and all :)
Was This Post Helpful? 0
  • +
  • -

#28 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6053
  • View blog
  • Posts: 23,488
  • Joined: 23-August 08

Re: PHP Challenge - Morse Code Translator

Posted 21 April 2012 - 08:04 AM

I was going for the as few lines of code as possible prize :D
Was This Post Helpful? 0
  • +
  • -

#29 CTphpnwb  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2913
  • View blog
  • Posts: 10,088
  • Joined: 08-August 08

Re: PHP Challenge - Morse Code Translator

Posted 21 April 2012 - 08:14 AM

View PostAtli, on 21 April 2012 - 09:29 AM, said:

He's just simulating real-world conditions: "implied" project requirements and all :)

That's what I thought I was doing when I included W3C validated HTML with my code:
Spoiler

Not trying to nit pick, though. I think judging is harder than writing code.
Was This Post Helpful? 0
  • +
  • -

#30 codeprada  Icon User is offline

  • Changed Man With Different Priorities
  • member icon

Reputation: 946
  • View blog
  • Posts: 2,355
  • Joined: 15-February 11

Re: PHP Challenge - Morse Code Translator

Posted 21 April 2012 - 04:46 PM

Most of the submissions were the same, split the text string and then loop through the array while flipping the morse code array for the morse-code-to-plain-text conversion, so I had to make the judging a bit harder. Would be boring if everyone got the same score all around.

@hiddenghost Your toPlainText() function gave me this
0                                      0                    0
The toMorseCode() conversion worked though.

@CTphpnwb I only tested it in CLI so the HTML wasn't really necessary.
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3