This is a discussion on programming challenge... within the Entertainment and Recreation forums, part of the General offtopic discussions category; OK, I have done a quick and dirty solution. I won't post the source code till others have finished. > ...
| |||||||
| Entertainment and Recreation Everything related to entertainment like movies, jokes and other funny stuff goes here |
| LinkBack | Thread Tools | Display Modes |
| | #21 |
| Platinum Member Join Date: Sep 2008
Posts: 3,140
Rep Power: 10 | OK, I have done a quick and dirty solution. I won't post the source code till others have finished. > !cc cc ddd.c > a.out source = 0, row = 0, col = 0, nr = 0, nc = 0 source = 1, row = 1, col = 0, nr = 1, nc = 0 source = 2, row = 0, col = 1, nr = 1, nc = 0 source = 3, row = 2, col = 0, nr = 2, nc = 0 source = 4, row = 1, col = 1, nr = 2, nc = 0 source = 5, row = 0, col = 2, nr = 2, nc = 0 source = 6, row = 3, col = 0, nr = 3, nc = 0 source = 7, row = 2, col = 1, nr = 3, nc = 0 source = 8, row = 1, col = 2, nr = 3, nc = 0 source = 9, row = 0, col = 3, nr = 3, nc = 0 source = 10, row = 3, col = 1, nr = 3, nc = 1 source = 11, row = 2, col = 2, nr = 3, nc = 1 source = 12, row = 1, col = 3, nr = 3, nc = 1 source = 13, row = 3, col = 2, nr = 3, nc = 2 source = 14, row = 2, col = 3, nr = 3, nc = 2 source = 15, row = 3, col = 3, nr = 3, nc = 3 acfj beim dhlo gknp > |
| | |
| | #22 |
| Gold Member Join Date: Jun 2009 Location: Pune
Posts: 487
Rep Power: 3 | Good job Farce!!! Did you find it challenging? |
| | |
| | #23 | |
| Guest
Posts: n/a
| Quote:
| |
| |
| | #24 |
| Platinum Member Join Date: Sep 2008
Posts: 3,140
Rep Power: 10 | Yes, it was challenging, since it took me a few iterations to get the logic right, and still I think I should improve the code and make it more elegant ;-) next version coming up soon. -F I didn't post the source code, so you have no idea how I did it ;-) I could have hardcoded the entire thing ;-) sorry, please continue with your coding, don't stop. -F Last edited by Punch Farce; 08-06-09 at 12:29 AM. Reason: Automerged Doublepost |
| | |
| | #25 |
| Gold Member Join Date: Jun 2009 Location: Pune
Posts: 487
Rep Power: 3 | |
| | |
| | #26 | |
| Guest
Posts: n/a
| Quote:
i'm coding in c++ only anyways. nandini, don't stop with this please | |
| |
| | #27 | |
| Gold Member Join Date: Jun 2009 Location: Pune
Posts: 487
Rep Power: 3 | Quote:
would love to know what your logic is. We can definitely learn out of this. Well you finish with the coding first. I did it in Java. I'll surely post problem that tests our analytical thinking and expects the same from you guys as well. | |
| | |
| | #28 |
| Jedi knight Join Date: Jul 2009 Location: IBF Age: 21
Posts: 1,818
Rep Power: 5 | Doing was writing a poem earlier. |
| | |
| | #29 |
| Platinum Member Join Date: Sep 2008
Posts: 3,140
Rep Power: 10 | take a string = "abcdefgh"; reverse this without using any temp variables ;-) -F |
| | |
| | #30 |
| Guest
Posts: n/a
| give me 30 -60 mins |
| |
| | #31 |
| Gold Member Join Date: Jun 2009 Location: Pune
Posts: 487
Rep Power: 3 | |
| | |
| | #32 | |
| Platinum Member Join Date: Sep 2008
Posts: 3,140
Rep Power: 10 | Just post the output of the run, not the source code till everone has a chance to attempt it. thanks -F Quote:
(with Cisco I think) and I did it at that time. Let's start trying with NO temp variables and then if that is impossible then we can use one. as usual post the results first and then the code after everyone completes. -F Last edited by Punch Farce; 08-06-09 at 01:12 AM. Reason: Automerged Doublepost | |
| | |
| | #33 |
| Gold Member Join Date: Jun 2009 Location: Pune
Posts: 487
Rep Power: 3 | Did you do it in c/c++, using pointers? A simple yes/no will do? lol |
| | |
| | #34 |
| Jedi knight Join Date: Jul 2009 Location: IBF Age: 21
Posts: 1,818
Rep Power: 5 | funny output: a e i m b f j n c g k o d h l p I was spoon fed this problem. Last edited by Luke Skywalker; 08-06-09 at 01:26 AM. Reason: Automerged Doublepost |
| | |
| | #35 |
| Platinum Member Join Date: Sep 2008
Posts: 3,140
Rep Power: 10 | |
| | |
| | #36 |
| Jedi knight Join Date: Jul 2009 Location: IBF Age: 21
Posts: 1,818
Rep Power: 5 | But can't recall the answer. trying with unicode give 45 min more. Last edited by Luke Skywalker; 08-06-09 at 01:32 AM. Reason: Automerged Doublepost |
| | |
| | #37 |
| Platinum Member Join Date: Sep 2008
Posts: 3,140
Rep Power: 10 | I am really really impressed with myself ;-) I rememebered 3 lines of code I did in an interview 10 years back! > !cc cc rrr.c > a.out before = abcdefgh after = hgfedcba > |
| | |
| | #38 |
| Gold Member Join Date: Jun 2009 Location: Pune
Posts: 487
Rep Power: 3 | Don't give us complexion, Farce. |
| | |
| | #39 |
| Platinum Member Join Date: Sep 2008
Posts: 3,140
Rep Power: 10 | |
| | |
| | #40 |
| Gold Member Join Date: Jun 2009 Location: Pune
Posts: 487
Rep Power: 3 | |
| | |
| Tags |
| challenge, programming |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Vote: would you like to have a programming section in IBF ? | newprouser | Suggestions and Complaints | 30 | 08-30-09 12:56 AM |
| Java Programming : Doubts | newprouser | Windows | 20 | 08-19-09 11:20 PM |
| Tata Sky Plus challenge | devrajofjaipur | Tata sky | 2 | 05-20-09 01:50 PM |
| Any how to videos for Flash Programming? | vishnu54 | Windows | 0 | 05-06-09 05:28 PM |