Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
Part1 Code:
#include <ncurses.h>
using namespace std;
int main(int argc, char ** argv)
{
int x,y;
x = y = 15;
// Initialises the screen
// Sets up memory and clears the screen
initscr();
// Refreshes the screen to match what's in memory
refresh();
// Moves the cursor to specified location
move(x , y);
// Prints a string(const char *) to a window
printw("Hello World!");
// Waits for user input, returns int value of that key
getch();
// Deallocates memory and ends nCurses
endwin();
return 0;
}
Part2 Code:
#include <ncurses.h>
#using namespace std;
int main(int argc, char ** argv)
{
int x,y;
x = y = 15;
initscr();
refresh();
move(x , y);
int man()
{
int i = 0;
char load[26];
while(i < 25)
{
system("clear");
load[i++] = '#';
load[i] = '\0';
printf("\n\nLOADING [%-25s]", load);
usleep(199900);
}
system("clear");
printf("\n");
}
Part 3 Code:
#include iostream.h
#include conio.h
#include windows.h
#include dos.h
void main()
{
system("color 0a");
cout<<"\n\n\n\t\t\t\tPlease wait while loading\n\n";
char a=177, b=219;
cout<<"\t\t\t\t";
for (int i=0;i<=15;i++)
cout<<a;
cout<<"\r";
cout<<"\t\t\t\t";
for (int i=0;i<=15;i++)
{
cout<<b;
for (int j=0;j<=1e8;j++); //You can also use sleep function instead of for loop
}
clrscr();
cout<<"\n\n\n\t\t\tHELLO WORLD\n\n\t\t\tShashka made by Ivan :P";
getch();
}
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
int main()
{
int i = 0;
char load[26];
while(i < 25)
{
system("clear");
load[i++] = '#';
load[i] = '\0';
printf("\n\nLOADING [%-25s]", load);
usleep(199900);
}
system("clear");
printf("\n");
}
#include <ncurses.h>
using namespace std;
int main(int argc, char ** argv)
{
int x,y;
x = y = 15;
initscr();
refresh();
move(x , y);
printw("Hello World!");
getch();
endwin();
return 0;
}
Part 4 Code:
void road() {
int choice2;
int choice3;
int event1;
system("cls");
cout << "You are on a road that heads west and east of your position." << endl;
cout << "Which way will you go?\n" << endl;
cout << "1. Go West" << endl;
cout << "2. Go East" << endl;
cout << "3. Wait for something to happen\n" << endl;
cin >> choice2;
cin.ignore();
system("cls");
if (choice2 == 1) {
int decision1;
cout << "You travel down the road, about only 100 metres and you encounter " << endl;
cout << "a giant spider with vicious poison coated fangs." << endl;
cout << "its hideous appearance causes your throat to dry and your knees to shake!" << endl;
cout << "What on earth will you do?\n\n" << endl;
cout << "1. Attempt to attack the spider with you sword." << endl;
cout << "2. Throw your sword in the off chance it might kill it." << endl;
cout << "3. RUN FOR YOUR LIFE!" << endl;
cin >> decision1;
cin.ignore();
system("cls");
if (decision1 == 1) {
cout << "You viscously swing your sword at the spiders general direction." << endl;
cout << "The swing was so great, your arms jolts out of place, \ncreating a surge of pain." << endl;
cout << "Your arm is now broken, and you fall to the ground in pain...." << endl;
cout << "The spider launches 3 metres straight into your body... \nWhat on earth is it doing?" << endl;
cout << "Oh My God! The spider is devouring everything...." << endl;
cout << "All that remained was bones of the once mobile adventurer " << name << endl;
system("pause");
gameover();
}
else if (decision1 == 2) {}
else if (decision1 == 3) {}
}
else if (choice2 == 2) {
cout << "After a mile walk, you arrive at an old brick house. " << endl;
cout << "You walk slowly inside." << endl;
cout << "The door slams behind you and the room lightens up." << endl;
cout << "What on earth is going on...?\n\n" << endl;
system("pause");
cout << "\nUnable to open the door, you look around for anything of use." << endl;
cout << "Nothing, not a single piece of furniture." << endl;
cout << "What will you do?\n" << endl;
cout << "1. Wait for someone to save you." << endl;
cout << "2. Or Wait for someone to save you." << endl;
cin >> choice3;
cin.ignore();
system("cls");
if (choice3 == 1) {
cout << "As you character relaxes his legs and begins to sit" << endl;
cout << "he leans against the wall, only to hit a hidden switch." << endl;
system("pause");
cout << "The floor beneath you disappears, and you start to plummet." << endl;
cout << "What a trap! You bloody stupid fool!\n\n?" << endl;
cout << "somehow you never reach the bottom....." << endl;
cout << "You die of water deprivation, after only 2 weeks of falling...." << endl;
system("pause");
gameover();
}
else if (choice3 == 2) {
system("cls");
cout << "After only 5 hours..." << endl;
cout << "The doors suddenly swoosh open." << endl;
cout << "You are free! " << endl;
system("pause");
cout << "You take your first steps into what is now moonlight," << endl;
cout << "and then suddenly pass out on the ground...." << endl;
cout << "For some peculiar reason or another, you are now /nback in the creepy dark and gloomy library. You swiftly escape its nostalgia. " << endl;
road();
}
}
else if (choice2 == 3) {
int random1;
cout << "After at least was seemed to be 4 hours " << endl;
cout << "a dragon swoops down from the heavens...." << endl;
cout << "and lands right in front of you!\n" << endl;
system("pause");
system("cls");
random1 = rand() % 2; // pseudo random generator
if (random1 == 0) {
int choice4;
cout << "Your character screams at the top of his lungs, " << endl;
cout << "this causes the dragon to immediately to bow in fear..." << endl;
cout << "It turns out dragons are very sensitive to hearing....." << endl;
system("pause");
cout << "\nIt seems the dragon is requesting you ride it!\n" << endl;
cout << "Will you ride it?\n" << endl;
cout << "1. Ride it" << endl;
cout << "2. Or Wait here." << endl;
cin >> choice4;
cin.ignore();
system("cls");
if (choice4 == 1){
Ending();
}
else if (choice4 == 2){
road();
}
}
else if (random1 == 1) {
cout << "Your character screams at the top of his lungs, " << endl;
cout << "eventually your breath gives out and you die because of lack of oxygen." << endl;
system("pause");
gameover();
}
}
}
Part 5 Code:
#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
using namespace std;
//Declare what character you want to be.
string name;
cin >> name;
int law = 1;
int gang member = 2;
cout << "Welcome to your adventure " << name << ". Which character will you be?\n"
<< "(1 for law, 2 for gang member)\n";
cin >> knight;
switch (law) // The law Adventure
case 1:
{
int y = 1;
cout << "You have chosen to become a law.\n"
<< "Welcome to the land known as Chronia.\n"
<< "Their is a strangely dressed women. Do you approach her? (1 for y, 2 for n)\n";
cin >> y;
break;
switch (y)
{
case 1:
{
int right = 2;
cout << "You ask the women who she is and she replies I AM MICHELLINA\n"
<< "How do I get back home? I DO NOT KNOW BUT IF YOU CAN GUESS IN WHICH HAND I HAVE THE COIN\n"
<< "I WILL GET YOU BACK HOME. Which hand is it in? (1 for left, 2 for right)\n";
cin >> right;
break;
}
case 2:
{
cout << "You do not approach her and get your head sliced off by an incoming horseman.\n"
<< "Game Over. You suck at adventure games.";
break;
}
switch (gang member)
case 2: // The gang member Adventure
{
int x;
cout << "You have chose to become a gang member.\n"
<< "Welcome to the land know as Remian.\n"
<< "Their is another gang member charging at you. Do you attack them? (1 for y, 2 for n)\n";
cin >> x;
break;
switch (x)
{
case 1:
int a;
cout << "The gang member head goes flying off and the horse bucks his body off and runs away scared.\n"
<< "You search his body and find a key and a map to get back home.\n"
<< "Do you want to get back home? (1 for y, 2 for n)\n";
cin >> a;
break;
}
}
}
return 0;
}
}