write full computer game code

Dec 22 2015 7:22 AM

Question

A new type of computer game is launched in the market, which requires a special type of gaming console. Makers of the games has made a new generation gaming console with a very unique remote. The keys/Layout of remote is as shown below

This remote contains 12 keys with 2 nonfunctional keys. Each functional key has been given a unique label as shown above.

The Computer game for this console has N levels. There are certain moves in the game which are controlled using the remote. The keys for each moves changes with the number of levels i.e. number of keys for an operation is dependent on the game level, for example for third level, single move require three key [you have to press three keys in sequence for a move in third level]. A player can only press keys that are left, right, up or down to the current key and he is not allowed to press bottom row corner keys.

Suppose a player is at level 2. According to the rules he has to press 2 keys for a move (the number of keys is equal to the level). The possible Moves key will be ‘HH’, ‘HI’, ‘HG’, ‘HE’, ‘HJ’, ‘IF’ ,.. Etc

1. If a Move start from ‘J’, possible keys are ‘JJ’, ‘JH’ (count 2)

2. If a Move start from ‘H’, possible keys are ‘HH’, ‘HI’, ‘HG’, ‘HE’, ‘HJ’ (count 5)

3. If a Move start from ‘I’, possible keys are ‘II’, ‘IH’, ‘IF’ (count 3)

-------------

-------------

So for level 2, number of possible moves would be 36.

If a player is at level N, you have to find the total possible number of moves for that level.

Input/Output Specifications

Input Specifications:

Input is an integer N, which is level of the game

Output Specifications:

Output is an integer M, which is the total possible number of Moves

Examples

Example:

Input: 2

Output: 36

Instructions:

1) Do not write main function.

2) You can print and debug your code at any step of the code.

3) You need to return the required output from the given function.

4) Do not change the function and parameter names given in editor code.

5) Return type must be the same as mentioned in the problem statement.

6) When you submit your code, 10 test cases of different complexity level are executed in the background and marks are given based on number of test cases passed.

7) If you do not plan to complete the code in one sitting, then please save your work on a local machine. The code is saved only when it has been submitted using Submit button.

8 ) Only two submissions are allowed.

using System;

public class CandidateCode

{

public static int combinationCounts(int input1)

{

//Write code here

}

}

 


Answers (2)