Entries Tagged 'Logic Builders' ↓
March 7th, 2006 — Logic Builders
Create a field of 6×5 size. That prints like the following:
-------------------------------
| 1 | 2 | 3 | 4 | 5 | 6 |
| 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 |
-------------------------------
The input to the application will be a string of numbers, separated by commands. E.g.
23,3,4,10
These numbers represent the mines on the field. And you have to put two crosses “XX” in their places. So the output will look like this:
-------------------------------
| 1 | 2 | XX | XX | 5 | 6 |
| 7 | 8 | 9 | XX | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | XX | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 |
-------------------------------
March 1st, 2006 — Logic Builders, Technology
Logic Builders are puzzles that you can implement in the programming language of your choice. Do one puzzle every week and you will certainly improve your programming skills many fold. IMPORTANT: Do not stop at thinking the logic. Implement the solution. That’s the most important part.
Problem 1: Arrange the circles
You will be given four value pairs. The first letter indicates the circle color and the next the quadrant in which it needs to be placed. The origin (0,0 position) of the plane on the whole screen will be specified by the fifth argument. You have to then arrange the four circles in appropriate quadrant.
Example input:
R4
G3
Y2
B1
23,45
Refer to the image to see an example of how the circles would be arranged.
