Saturday, October 23, 2010

Coding skill +1 (Jan-Ken-Pon of DOOM in C++)

More code from over half a decade ago!
// Jan-Ken-Pon of DOOM by Dopefish
#include <iostream>
#include <ctime>
#include <stdlib.h>
#include <conio.h>

using namespace std;

void score(int iW, int iL, int iT)        // Function for writing out the score
{
    cout << "Win: " << iW << " Lost: " << iL << " Tie: " << iT << endl;
}


int main () 
{
    int iFool;        // Random start message
    int iComp;        // Computer choice
    int iPlay;        // Player choice
    int iLost;        // Lost counter
    int iWin;         // Win counter
    int iTie;         // Tie counter
    bool bGame;       // Game status
    bGame = 1;        // Game is active
    srand (time(0));  // Random seed from system clock
        

    cout << "Welcome to Jan-Ken-Pon of DOOM!" << endl;
    while (bGame == 1)
    {
        iComp = (1 + (rand() % 3));    // Comp choice on random (1=Rock, 2=Paper, 4=Scissor)
        if (iComp == 3)
        {
            iComp = 4;        // 3 is changed to 4 (Scissor) for calc purposes
        }


        iFool = (rand() % 3);        // Random start message
        switch(iFool)
        {
            case 1:
                cout << "I'll cut your throat with my scissor!\n" << endl;
                break;
            case 2:
                cout << "You'll eat my rock!\n" << endl;
                break;
            default:
                cout << "I'm going to slice you up with my paper!\n" << endl;
                break;
        }


        cout << "What are you going to do:" << endl;
        cout << "1. (Rock)\n2. (Paper)\n3. (Scissor)\n4. (Give up!)" << endl;
        cin >> iPlay;
        cout << endl;

        switch(iPlay)
        {
            case 1:
                cout << "Rock" << endl;
                break;
            case 2:
                cout << "Paper" << endl;
                break;
            case 3:
                cout << "Scissor" << endl;
                iPlay = 4;            // 3 is changed to 4 for calc purposes
                break;
            case 4:
                cout << "You run away in to the distance..." << endl;
                bGame = 0;
                break;
            default:
                cout << "That wasn't an option sucker!" << endl;
                cout << "I don't play with cheaters..." << endl;
                bGame = 0;
                break;
        }


        if (bGame == 1)
        {
            switch(iComp)
            {
                case 1:
                    cout << "Rock\n" << endl;
                    break;
                case 2:
                    cout << "Paper\n" << endl;
                    break;
                case 4:
                    cout << "Scissor\n" << endl;
                    break;
            }
        }


        iPlay = iPlay - iComp;    // Win, Tie or Loose check (1=Rock, 2=Paper, 4=Scissor)
        switch(iPlay)        
        {
            case -3:    // Rock vs Scissor
                iWin++;
                score(iWin, iLost, iTie);
                break;
            case -2:    // Paper vs Scissor
                iLost++;
                score(iWin, iLost, iTie);
                break;
            case -1:    // Rock vs Paper
                iLost++;
                score(iWin, iLost, iTie);
                break;
            case 0:        // Both picked the same
                iTie++;
                score(iWin, iLost, iTie);
                cout << "Hmm... that was strange... ";
                break;
            case 1:        // Paper vs Rock
                iWin++;
                score(iWin, iLost, iTie);
                break;
            case 2:        // Scissor vs Paper
                iWin++;
                score(iWin, iLost, iTie);
                break;
            case 3:        // Scissor vs Rock
                iLost++;
                score(iWin, iLost, iTie);
                break;
        }


    getch();
    }    // end of while loop

    return 0;

}    // end of main

Coding Skill +1 (Zombie mower in C++)

Found some code I did over half a decade ago :)


// Zombie mower by Dopefish
#include <iostream>
#include <iodos.h>
#include <conio.h>

using namespace std;

int main()
{
 dos_console();

 int zombies = 1;

 cout << "How many do you see standing on the lawn?" << endl << "> ";
 cin >> zombies;

 while (zombies > 0)
 {
  cout << zombies << " zombies left under the moon" << endl;
  cout << zombies << " zombies is going to be mown" << endl;
  cout << "If one of em' happens to be mown," << endl;
  zombies--;
  cout << "then it's only " << zombies << " left on the lawn" << endl << endl;
 }

 if (zombies < 1)
 {
  cout << zombies << " zombies left under the moon" << endl;
  cout << zombies << " zombies is going to be mown" << endl;
  cout << "There are no more zombies left to mown..." << endl;
 }

 getch();
 return(0);
}

Thursday, October 07, 2010

Deus Ex 3 Gameplay footage


ModDB Spotlight September 2010

nDo - Normal creation toolkit!

"Yesterday at about 10:43am (PST), teddybergsman posted a thread in the Pimping & Previews forum that caused quite a stir and also caused a lot of jaws to drop. With his first post, he became an instant legend in the Polycount community by sharing his normal mapping toolkit called nDo.

nDo has a wide variety of normal map creation features, which gives the user great control to create quality normal maps all within Photoshop in a simple and easy to use script."
nDo tutorial by Philip Klevestav
Polycount - nDo Normal Map Creation Toolkit
nDo Download and Installation Instructions