Hello There, Guest!
View New Posts  |  View Today's Posts
Challenge #27: Addition PPC

  • 0 Vote(s) - 0 Average


08-24-2013, 09:51 PM #11
AceInfinity
Developer
*******
Administrators
Posts: 9,733 Threads:1,026 Joined: Jun 2011 Reputation: 76

RE: Challenge #27: Addition PPC
For those that want to try to solve this *manually* by typing in solutions to each equation, I'll provide a binary below for doing that... Good luck :)

You probably won't end up solving it manually, but it's still fun to run this executable for entertainment. Thumbs Up



There's a link in the attachment for the download.


Attached Files
.zip   summation_ppc.zip (Size: 9.99 KB / Downloads: 1)
This post was last modified: 08-24-2013, 09:55 PM by AceInfinity.


Microsoft MVP .NET Programming - (2012 - Present)
®Crestron DMC-T Certified Automation Programmer

Development Site: aceinfinity.net

 ▲
 ▲ ▲

08-25-2013, 04:33 AM #12
Icecube
Team Reboot
Team Reboot
Posts: 34 Threads:2 Joined: Jan 2012 Reputation: 5

RE: Challenge #27: Addition PPC
Or you can also install nmap and use the ncat (netcat) program:
http://nmap.org/

08-27-2013, 10:26 AM #13
Icecube
Team Reboot
Team Reboot
Posts: 34 Threads:2 Joined: Jan 2012 Reputation: 5

RE: Challenge #27: Addition PPC
[spoiler="Spoiler: Some socket programming links"]

Socket programming with winsock:
http://www.binarytides.com/winsock-socke...-tutorial/

Socket programming in C:
http://www.go4expert.com/articles/socket...-c-t22417/

Socket programming in python:
http://www.binarytides.com/python-socket...-tutorial/

Socket programming in PHP:
http://www.php.net/manual/en/sockets.examples.php

Socket programming examples in python, perl, C and java:
http://www.prasannatech.net/2008/07/sock...orial.html
[/spoiler]

08-27-2013, 06:44 PM #14
AceInfinity
Developer
*******
Administrators
Posts: 9,733 Threads:1,026 Joined: Jun 2011 Reputation: 76

RE: Challenge #27: Addition PPC
I'm surprised nobody else has solved this yet or that more haven't attempted this... This one took me less than an hour to figure out in total. The difficulty with the Sudoku one was parsing and solving the puzzles.
This post was last modified: 08-27-2013, 06:46 PM by AceInfinity.


Microsoft MVP .NET Programming - (2012 - Present)
®Crestron DMC-T Certified Automation Programmer

Development Site: aceinfinity.net

 ▲
 ▲ ▲

08-28-2013, 04:12 AM #15
Icecube
Team Reboot
Team Reboot
Posts: 34 Threads:2 Joined: Jan 2012 Reputation: 5

RE: Challenge #27: Addition PPC
(08-27-2013, 06:44 PM)AceInfinity Wrote:  I'm surprised nobody else has solved this yet or that more haven't attempted this...
I am also surprised that only 3 people tried or succeeded (actually 4, when I include myself Wink2).

Because this challenge is quite easy, I will add a second step:
Try to solve it in more than one (as many as possible ??) programming language.
My previous post should give you some starting points for different languages.

At the moment I solved it in python and awk (gawk is the only awk version that I know of that has sockets).

08-28-2013, 08:37 AM #16
AceInfinity
Developer
*******
Administrators
Posts: 9,733 Threads:1,026 Joined: Jun 2011 Reputation: 76

RE: Challenge #27: Addition PPC
I would try Lua, but I don't know enough about multi-threading to avoid the blocking that happens on the calling thread when connect is called for creating a socket. I only know a little Lua.


Microsoft MVP .NET Programming - (2012 - Present)
®Crestron DMC-T Certified Automation Programmer

Development Site: aceinfinity.net

 ▲
 ▲ ▲

10-31-2013, 01:19 AM #17
KoBE
¯\_(ツ)_/¯
******
Global Moderators
Posts: 4,862 Threads:494 Joined: Jun 2011 Reputation: 67

RE: Challenge #27: Addition PPC
Whew, I finally got this. My first approach was to use the TcpClient and use the stream to talk back and forth. Well, that didn't work. Something it was doing with the actual socket class below wasn't leaving handling the connection properly. Then I decided to go lower and use the actual Socket class. All was going well except for the stupid Console.WriteLine() was stalling when trying to print null characters. So, I spent a bit of time trying to figure what the heck the problem was. After that, it was a piece of cake. Just got done refactoring it.

I thought about posting the code in a spoiler tag. But, considering there is only three people to solve it, I guess if Ace or Icecube want to see it you guys can PM me :D
This post was last modified: 10-31-2013, 01:20 AM by KoBE.

10-31-2013, 09:25 AM #18
AceInfinity
Developer
*******
Administrators
Posts: 9,733 Threads:1,026 Joined: Jun 2011 Reputation: 76

RE: Challenge #27: Addition PPC
I solved this and the other Sudoku one in C++. I didn't write my own Sudoku solver for the C++ solution of the other though, I used a 3rd party library to do that, and just utilized it by modifying parts of it so I could send data in the proper format to the server. If someone wants to see my C++ solution, I'll post it... It's nothing special. The additions only consist of 2 numbers, so I didn't have to do much for advanced parsing. Otherwise I would have used my RPN expression evaluation class I created a little while ago, converting from infix to RPN notation with Dijkstra's algorithm (shunting yard), and evaluating in a stack based way to find answers.

This one is recommended to start with over the Sudoku one though. That one was a bit more challenging.

Injured my knee at work yesterday so I'll be working on a website instead, and programming for today. Not fun lol (the injuring my knee part of course).
This post was last modified: 10-31-2013, 09:28 AM by AceInfinity.


Microsoft MVP .NET Programming - (2012 - Present)
®Crestron DMC-T Certified Automation Programmer

Development Site: aceinfinity.net

 ▲
 ▲ ▲




Forum Jump:


Possibly Related Threads...
Thread Author Replies Views Last Post
  Challenge #28 - A Bashing Challenge Holmes.Sherlock 1 3,992 01-31-2015, 01:57 PM
Last Post: Holmes.Sherlock
  Challenge #26: Sudoku ppc Florin 16 9,059 08-14-2013, 03:47 PM
Last Post: AceInfinity
  [Question] Quick Google Challenge! Don't cheat! Florin 9 6,152 07-28-2012, 01:09 AM
Last Post: Florin
  Challenge #13 - Can you find the key? AceInfinity 3 2,961 05-17-2012, 08:05 PM
Last Post: AceInfinity
  Challenge #1 - Is she alone? AceInfinity 20 10,907 04-21-2012, 07:26 PM
Last Post: AceInfinity


Users browsing this thread: 1 Guest(s)