Saturday, February 5, 2011

Code Guru : Revelation 2011


Winners: Heena Gupta (I) , Sowmya (II), Aditya G (III)

Other is top 10 in order
Charu J, Jyotsana, Raju K, Boopalan R, Rakesh K, Lakshminarayan, Nibedita S
Questions Were

1. In Zee land , they study Zaths. Some numbers are considered as Zamazing number and some as Zawesome
A number is considered Zawesome if 2109 is found somewhere in the number together
eg. 122312109876
A number is considered Zamazing if 2109 is found somewhere in the number
eg. 12921990982
Write a program to check if an inputted number is Zamazing or Zawesome or not

2. If A thinks of a 4 digit number in which each digit is unique, B takes a guess
eg. A thinks : 7345 B Says 9647 : A says 1 Zing (because 7 is correct but in wrong place) 1 Zong (because 4 is correct and in right place)
eg. A thinks : 7345 B Says 9347 : A says 1 Zing (because 7 is correct but in wrong place) 2 Zong (because 3 and 4 is correct and in right place)
Game is over if B Guesses 7345 and A says 4 Zongs !!!
Assume both numbers have no repetition of digit
Create a game where computer thinks of a 4 digit number and lets users answer with a 4 digit number . Computer should reply how many zings and zongs. Computer should allow user to attempt as many time needed to zolve the puzzle

3. Make a an array of 9 by 12 as shown in sheet 2.
0 means land 8 means rain drops
Make the exact landscape as displayed in the next sheet under Level 1
Level 1: Raindrops fall in each round but they do not go side ways
Level 2: Raindrops try to fall if not possible slide in case gap at lower level. In case 2 drops in contention for slide preference for the one drop which slides right as this is the Northern Hemisphere ??
Level 3: Multiple round of rain should work
Level 4: Make it work in this different landscape, If a drop can fall both left and right it will fall right
Level 5: In case a whole is made at bottom of the land show how the water will flow out

4.Make a variation of Zing Zong (question 2) where user thinks of a number and computer takes guesses
A good algo will solve any 4 digit number in 7 or less guesses

Saturday, October 16, 2010

Sudoko Solver

Wrote a small application to solve a Suduko puzzle in C#, I was doing C# coding after some years now and I thoroughly enjoyed it

If you are interested you may wont to give it a try.

Step 1: Make a grid of text boxes (81 of them !!! ), load it into an array of objects
Step 2: Write function checkRow to see if no two numbers are repeated
Step 3:Write function checkColumn
Step 4:Write function checkBox
Step 5:Write function findAllPossible(for a particular position)
Step 6:Write function findAll(for all 81 position)
Step 7: Check is their a number in a row which is allowed only in that position, then that number is to be placed there
Step 8: Check is their a number in a column which is allowed only in that position, then that number is to be placed there
Step 9: Check is their a number in a box which is allowed only in that position, then that number is to be placed there
Step 10:Do color coding for duplicates. Make new entries come in green or something

Future Enhancements : Undo, History, Game Generation, Guessing in case direct solving does not work

Time : ~15 hours of coding ..... more because there was many things I was not sure how to do in C#, because of the gap ... try it, it is fun

Thursday, August 26, 2010

Code Guru : Gateways 2010

Conducted Code Guru in Christ University for the MCA/M.Sc Students. There was 4 questions and an hour to code and get them executing. This time top three were able to do all four questions in the allotted time and competition ended up as a nail biting finish for the IInd and IIIrd place.

Winners are :
1. Aditya Gopalakrishnan
2. Heena Gupta
3. Mahesh D
4. Rakesh Kashyap
5. Jyothsna K
6. Andrew Pereira
7. Raju K
8. Lakshmi Narayanan
9. Sowmya Stephen
10. Mark Godfrey

Time : 1 Hour
Compiler : C/C++/Java/.Net
Questions :
1. Convert a mixed string to alternate upper and lower case
2. Validate a date in mm-dd-yy and convert to dd-mm-yy
3. If user enters 2 (line) 3 (triangle) 4 (square) 5 (pentagon)
4. Create a game which is like a puzzle
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15

1 2 3 4
5 6 7
9 10 11 8
13 14 15 12
User should be able to move left,right,up,down,randomise and sort the puzzle

Questions prepared by J S Saleema, Deepthi Das, Jibrael Jos

Monday, July 5, 2010

Coding is Fun



When I joined CMC in 1996 there was in my class Ashish Patkar and Neeraj Parashar who already knew coding quiet well and even though I had coded in Basic and Pascal, I knew they both were much ahead of the game.

Rajesh and I , were given challenge problems to code from these two stalwarts and two programs which I remember coding was the "Lift","Cross and Knots", "PingPong". Another program Arun and I had coded in those days was "Cows and Bulls".

We loved coding it and today I give similar problems to students in Christ University.

We all work in different organisations and different cities now but I am sure wherever we are we all will agree that coding is fun

(Lift Coded by Kitti, Ping Pong coded different versions by Sr Smitty , Amit, Gaurav , Jabez, Sufian)

Monday, February 15, 2010

Code Guru : Revelation 2010

Conducted a programming competition to identify the Top 5 coders in MCA /M.Sc Programs running here in the Department of Computer Science at Christ University. There was a very good response for the same

The students were to code these directly onto their laptops in any language of their choice. As each question was completed the times were noted for each individual

They could only move to next question after completing current level.

Top 5 (in order) : Nibedita S, Raju K, Mahesh K, Aditya G, Rakesh K,

Rank 6-10 : Heena S, Mac, Karan B, Neha S, Leo
The questions were
Question 1
Ask user to input 10 number into an array A
Prepare two arrays(O,E) one which contains odd and one which contains even

Question 2
Take a string, Implement a code such that
All characters are right shifted by 3.
So “CAT” will become “FDW”

Additionally all words length are reversed
“THIS IS A CAT” (4,2,1,3)

would be
WKL V LV DFDW (3,1,2,4)

Question 3
If user inputs a number it should display the number in big form eg .1,3
*
*
*
*
*
Implement for all 10 digits

Question 4
Find all combination for 4 digit number
Eg. for 3 digit number : 123
123,231,312,213,132,321
Higher marks for better algo

Question 5
On a chess board you want to place 4 rooks and 4 bishop such that no two pieces cut each other
Rook Moves side ways, forward and back
Bishop moves diagonal
Can you write a program to find any eight places

Question 6
Modify program 2 such that height can be defined

Monday, November 16, 2009

Think First

Recently Conducted a Programming Workshop in Christ College along with Rohini Maam. The workshop would not have been possible without the guidance and encouragement of our department's HOD, Prof. Joy Paulose.

The workshop was conducted on 5,6,7 Nov 2009 the basic objective was to get those students who were not top class in programming to get into the groove.

The workshop included games and team activity. Programming was done as individual and group.

One the final day Clement and Renjith from MindTree shared their programing experiences and gave insight as to how they would do the MCA program if they were given a second chance at college.

The students were very enthusiastic and conducting the workshop was very satisfying.

Some star performers were Jyotsana, Suneesh Thampi, Stanley, Raju and Infanta

Some Programs which the students wrote from scratch without any external help are

Display numbers from 1 to 50
Display even numbers from 2 to 50
Create a square box 10 by 10 filled with asterix
create a square box with asterix only on the perimeter
Make a triangle with asterix starting with 10, then reducing by 1
Make a triangle with asterix starting with 1,then 3,5,7,9 …… it should be centrally alligned like a pyramid
Make a square box like Q3 but leave a plus sign of space in the box
Make a simple plus symbol with asterix of height 10
Write a program to print Fibonacci Numbers
Write a function to insert 10 numbers into an array using scanf
Write a function to DISPLAY ARRAY Content
Write a function to populate array randomly
Write a Function to search in an array for an integer
Write a Function to Binary search in an array for an integer
Print odd numbers from 1 to 51
Depending on input (1 to 10), Tables should be displayed eg if input is 7

7*1=7
7*2=14
7*3=21
If a number is entered , return the sum of digits eg. 324 should return 9 (3+2+4)
Use % and /
Print first 50 Prime Numbers
A prime number is a number divisible by no other number except 1 and itsel
Program to convert your name into ascii characters and print it
Program to find the value of a to the power of n, where a and n are inputted by the user (without using loops)
Program to convert your name to long integer and print it
Program to half your name into two and reverse it eg RAKESH will become KARHSE
Program to find the value of a to the power of n, where a and n are inputted by the user (without using loops)
Convert above programs to individual functions and create a menu to call the above programs


Why do you not give it a try ? Can you do all these programs in under 2 hours ?

Thursday, September 3, 2009

Level 1 Self Certification Results

Correct Entries Received So Far
Pradeeep Kaltari MindTree: 13/14 Q : 1 Hr : 20 Minutes
Marks : 90%
Karan B : Christ University : 14/14 Q: 1 hr 50 minutes
Marks : (Yet To Give Score)