Make your very own game using Visual C++ Express Edition (or in any PL)

I’m sure you all have heard of “Guess the number” game. Well who hasn’t. It’s practically in every programming book of every programming languages by every programming authors. The reason perhaphs is you can actually make billions of games from it. All you need to do is make up some weird stories with number guessing involved in there then you are good to go. Here are some examples:

1. Mind Reader Game

Here's the code:

#pragma endregion
  //declare two variables. intrandom will handle the generated random numbers
  //intcounter will handle the number of incorrect guesses
   int intrandom;
   int intcounter;
 private: System::Void guessbutton_Click(System::Object^  sender, System::EventArgs^  e) {
  //create a random object named randgen based on the Random class
     Random^ randgen=gcnew Random();
     //generate a random number from 1 to 31 and store the generated number into a variable named intrandom
     intrandom=randgen->Next(1,31);
     //if the date inputted by the user is lesser than the generated number
     if (int::Parse(this->datetextBox->Text)statuslabel->Text="Sorry. Your guess is wrong. Perhaps you need some crystal ball?";
   //if its lesser than the generated number obviously the user has guessed it wrong so we acummulate the value
   //of the intcounter variable.
     intcounter=intcounter + 1;
     }
   //if its greate than the generated number
     else if (int::Parse(this->datetextBox->Text)>intrandom)
     {
      //display this message
      this->statuslabel->Text="It's not what the audienced had picked.Perhaps you need some chant or something.";
   //if its greater  than the generated number obviously the user has guessed it wrong again so we acummulate the value
   //of the intcounter variable.
      intcounter=intcounter + 1;
     }
     else
     {
    //if the user has guessed it right. display the follwing message and disable the textbox.
      this->statuslabel->Text="You guessed it right. Congratulations! You are now a fullfledge magician.";
      this->datetextBox->Enabled=false;
     }
    //if the user has guessed it wrong thrice 
     if ( intcounter>2)
     {
    //dsiplay this then disbale the textbox.
      this->statuslabel->Text="You have failed the test. Your remaining magic powers will be taken from you.";
      this->datetextBox->Enabled=false;
     }

    }
};
}





2. Oil Magnate Game

Here's the code:

#pragma endregion
//I wont add comments on this one coz it’s practically the same code. we only //added random responses from the user if the answer is the answer is wrong
   int intrandom;
   int intcounter;
 private: System::Void guessbutton_Click(System::Object^  sender, System::EventArgs^  e) {
 
     Random^ randgen=gcnew Random();
   
     intrandom=randgen->Next(20,50);
   
     if (int::Parse(this->agetextBox->Text)Next(1,2);

     if (intrandom==1)
     {
     this->statuslabel->Text="Im flattered but I'm not that young.";
     }
     else
     {
     this->statuslabel->Text="I have a feeling  that you are just making fun of me.";
     }

        intcounter=intcounter + 1;
     }
  
     else if (int::Parse(this->agetextBox->Text)>intrandom)
     {
 
     intrandom=randgen->Next(1,2);

     if (intrandom==1)
     {
     this->statuslabel->Text="That's rude, I'm not that old.";
     }
     else
     {
     this->statuslabel->Text="Are you stupid or something?";
     }
 
      intcounter=intcounter + 1;
     }
     else
     {
   
      this->statuslabel->Text="Congratulations! You have won the 3 billion dollars.";
      this->agetextBox->Enabled=false;
     }
 
     if ( intcounter>2)
     {
 
      this->statuslabel->Text="You have used the maximum number of guesses and won nothing.";
      this->agetextBox->Enabled=false;
     }

    }
};
}

So there...enjoy game programming :)

Say "Hello" to Blender and Flash

I have not written any programming guide in a while now coz I’m sort of in a “hiatus” or something. But I’ll post some as soon as my dopamine level rises up.

Meanwhile, if you are interested in things that move i.e. computer graphics, some of the great computer graphic softwares out there are Blender 3D and Adobe Flash.

Here are some of the basic animations that you can do with flash. These are made by my former students, I captured them using KRUTS and edited using PD11. Enjoy!



Here are some of the basic blender animations that you can do with blender. These are made by my former apprentices, you’ll see their names at the end of the movie. Anyways, enjoy!

Mousey the Junkbot

Mousey the Junkbot is a photovore(light-seeking robot) originally developed by Gareth Branwyn. It uses an old analog mouse, motors, light sensors. etc. It's not quite complicated to make and the steps in building it are readily available in the Internet. So if you have an idle time and you want to feel a sense of fulfillment or something, go ahead and build one.

Here’s a mobile video of a robot mouse made by one of my very appreciated minions.Lol. Enjoy!

How To Install WordPress On A Web Server Without MySQL Or CPANEL

Today we’ll be learning how to install WordPress on a web server without a CPANEL or MySQL database, just pure FTP. I’m sharing this because I run into similar problem before. The ftp server on the site that I’ve developed is not synchronized with my web server’s CPANEL thereby making it impossible to connect the database that I made there. It almost drive me crazy or something. I’ve searched the net for answers, but I haven’t found any clear solutions there and so I decided to do something about it. That’s like life actually, either you accept things as it is or you do something about it. Just kiddin.
The solution is surprisingly simple, upload WordPress on your ftp server, and since you don’t have a CPANEL, you can create a MySQL database using a free data provider outside of your web server such as freemysql.net or freesql.org . The details are listed in the following steps:
1. Download the latest version of WordPress from http://wordpress.org/.
2. Extract the downloaded files.
3. Start Filezilla(If you don’t have Filezilla installed, you can download it from http://sourceforge.net/projects/filezilla/files/FileZilla_Client/3.5.3/FileZilla_3.5.3_win32-setup.exe)>Enter your FTP server host, username and password then click quick connect.

4. Upload the contents of the wordpress folder to the public_html folder.
5. Open your web browser. Enter the URL of your site on the address bar.
6. Click Create Configuration File>Let’s Go button. The following should then appear.
7. Since we do not have CPanel and we can’t obviously create a MySQL database file which is needed in this window>Press CTRL + N. This will open up a new browser window. Enter freemysql.net in the address bar. The following should then appear:

Freemysql.net is a great site that offers free MySQL database storage for FREE.

8. Click the client area> then register.
9.After you have registered. Login to your account and create a MySQL database file. Remember the name of the database file that you have made because that will be used as your wordpress database name.
10. If you look on the bottom of your freemysql.net account, you will see your host or server name:
11. Now switch the browser screen to your WordPress configuration file then enter your freemysql.net database credentials>Click Submit.
12. Click the Run the Install button> And follow the on screen installation process to install wordpress.

Note: For more information, visit the wordpress official installation guide here http://codex.wordpress.org/Installing_WordPress. That’s all.