Entries Tagged 'Logic Builders' ↓

Measure the path

In Logic Builder this time, I am going to ask you to flex your mind muscles a bit to think of the input parameters for the problem, rather than the main solution.

The problem is: How can we measure the path a laser beam has to travel if it wanted to reach from the inner most track to the outer most. ie. from the beginning of the disk to the end. What all parameters will we need to calculate this correctly? Define these parameters and write a program to calculate the length of this path in centimeters.

 

Keyword Generator

Here’s another Logic Builder!

Write an application that will take a block of text as input and generate a list of keywords from it. You can make the app as simple or as complex as you want.

A few notes:

  • You can remove words with less than 3 characters
  • You can remove common words
  • You can remove verbs, and use only nouns
  • You can use some third party webservice to generate the keywords
  • You can remove duplicates

 

Growing Baby

It’s Logic Builder time again! Here’s a simple one!

Kids grow very fast! This time, you have to write a small application that will show you the height growth of a kid. The input parameters will be:

  • Birth Date
  • Height on birth
  • Growth in inches every week

The output should be the dates on which the growth from last date touches one inch. The output should stop at 6 feet height.

Suppose, the baby was born 1st January 2005. The height on birth was 20 inches and the baby grows one inch every week. Then the output would go something like:

2005-01-01 20
2005-01-08 21
2005-01-15 22
2005-01-22 23
2005-01-29 24
2005-02-05 25
2005-02-12 26
2005-02-19 27
2005-02-26 28
2005-03-05 29
2005-03-12 30

…. and so on till 72 inches.

Simple? Go ahead and try it out!

 

Encode Decode

This is a simple decoding puzzle. And will set you for some more interesting ones in the future. The test you can have for yourself, is how *fast* can you solve this.

The encoding / decoding has to work only for digits. 0 (zero) to 9 (nine). The first input will be a string of 10 characters. This encoding key will define what the mapping with 0-9. The next will be a mathematical operation that you have to carry out. The equation will be in encoded format, you have to decode and provide the answer.

Consider the example:

Input 1:
2345678901

Input 2:
12 + 23

Answer:
91 (90 + 01)

See if your code can work even with characters and symbols as the encoding key!

 

Bowling Alley

Puzzle 3 - Bowling Alley

You may have played the game of bowling. This time’s logic builder is to build a very simple bowling game to find out how many pins you knocked down.

Bowling Alley

Rules

  • 10 pins. Numbered 1 to 10. As shown in the image
  • Ball will hit a front pin only, hitting a pin is ensured to knock it down
  • Every pin knocked, will knock down two adjuscent pins in the next line if they are up. So hitting 5 will knock down 5, 1 and 2. Hitting 10 will knock down all pins.
  • No need to worry about the angle or speed at which the ball will hit the pin.

Input

  • The number of the pin the ball hit. 0 if no pins hit.

Output

  • The count of pins knocked down.
  • If you can show which pins were knocked, that is a bonus!

Go figure!

And if you wanted to play some online Bowling, you can do that on Yahoo! Games