Wednesday, January 16, 2013

I can guess the answer

Hi

I'm so sorry I haven't written for so long. My work keeps me so busy that I never have one minute for myself. Any way, I'm now here with a new game. It can guess the answer which you have selected by asking some questions.




You can play now:







You can download the game from here.

You can have this game anywhere just by adding the 'guess.js' script. Since it is a jquery based game, so you should also add jquery script in your page. Then, you should call the main method. The following sample shows you how to do it:

1    <html> 
2    <head> 
3        <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.0.min.js"></script> 
4        <script type="text/javascript" src="js/guess.js"></script> 
5        <script type="text/javascript"> 
6            $(function () { 
7                $("#guess").guessAnswer(); 
8            }); 
9        </script> 
10   </head> 
11   <body> 
12   <div id="guess"></div> 
13   </body> 
14   </html>




You can also add your own questions and answers dynamically. Following sample shows you how to do it:

1    <html> 
2    <head> 
3        <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.0.min.js"></script> 
4        <script type="text/javascript" src="js/guess.js"></script> 
5        <script type="text/javascript"> 
6            $(function () { 
7                $("#guess").guessAnswer([ 
8                    {id:87, question:"Is it an electronic device?", level:2} 
9                ], 
10                       [ 
11                           {answer:"Book", positiveAnswerQuestions:[1, 7, 16, 26, 29, 39, 40, 41, 43, 77]}, 
12                           {answer:"Computer", positiveAnswerQuestions:[1, 87, 35, 39, 40, 41, 46]} 
13                       ]); 
14           }); 
15       </script> 
16   </head> 
17   <body> 
18   <div id="guess"></div> 
19   </body> 
20   </html>




I hope you enjoy it.