OAKYHUB OPEN SOURCE SOFTWARE CENTER
3 posters
Page 1 of 1
OAKYHUB OPEN SOURCE SOFTWARE CENTER
you want the source code nerds? get ready to see this abomination of trash that fits the name to trashbot (those is from when i first started to reuse java and the robot class for my class) and many others!
this is my source for everything ottd-related with more to come
will add more shit later
this is my source for everything ottd-related with more to come
oakyhub open source software center
- Text Adventure Template {GCC / WINDOWS}:
- Code:
/*
============================================================================
Name : Flade's Adventure
Author : oaky
Version : 1.00
Copyright : fuknerds license
Description : flade's exciting adventure
============================================================================
*/
#include <stdio.h>
#include <stdlib.h>
#include <windows.h> // for windoze support
int health = 100;
int armor = 0;
void main() {
startGame(); // Begin game, and continue until the game is beaten.
return 0;
}
void startGame() {
char input; // Only one character in size.
printf(" Text Adventure Game! \n");
printf("You are in a dark room. Your hands are binded. What do you do? \n");
printf("(S)ay 'help!' | (B)reak your bonds | (C)ommit Adultery :>");
scanf("%c",&input); // Pointer for input (determined to be a char by %c)
// Input check
if(input == 's') {
write("You shout for help, but nobody hears you. \n");
write("You slowly starve to death. \n");
update(0,0);
blinkGameOver();
return;
}
if(input == 'b') {
write("As hard as you can, you struggle to break free from the bonds. \n");
write("You slowly starve to death. \n");
update(0,0);
blinkGameOver();
return;
}
if(input == 'c') {
write("Adultery is sinful. \n");
// Zap!
write("You were struck down by the lord. \n");
update(0,0);
blinkGameOver();
return;
}
}
void write(char input[]) { // The glorious write-it-out method.
int i; // Declare counter.
for(i=0;i<strlen(input);i++) {
printf("%c",input[i]);
if(i & 1) { // Every other character.
if(input[i] != " ") { // If the character is not a space.
Beep(400,10);
}
}
Sleep(50);
}
}
void update(int healthAmt, int armorAmt) {
Sleep(1000);
health = healthAmt;
armor = armorAmt; // Set values equal to what is given.
if(health == 0) { // If the game is over, play this noise and print the text as the 'death beep' plays.
Beep(2500,500); // Heart monitor sound.
Beep(0,500);
Beep(2500,600);
Beep(0,700);
Beep(2500,700);
Beep(0,900);
printf("\n HEALTH: %d \n",health);
Beep(2500,3000);
}
else { // Otherwise, just show the health (and armor).
Beep(200,1000);
printf("\n HEALTH: %d \n",health);
}
if(armor > 0) {
printf("ARMOR: %d \n",armor);
}
}
void clearScreen() {
printf("\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n"); // Clear the screen.
// Note: clear-screen speed?
}
void blinkGameOver() {
int i; // Declare counter.
int i2; // Other counter.
printf(" "); // Prints without tapping.
write("GAME OVER \n");
Sleep(1000);
for(i=0; i<1000; i++) {
for(i2=0; i2<10; i2++) {
printf(" GAME OVER \n");
clearScreen();
}
}
}
- Text Adventure Template/Engine {C/POSIX}:
- Code:
/*
============================================================================
Name : text adventure [posix]
Author : oaky
Version : 1.00
Copyright : fuknerds license
Description : sample adventure that can be made with this quality engine with improved unix functionality
============================================================================
*/
#include <stdio.h>
#include <unistd.h>
#include <curses.h> // needed for that glorious beep
//uncomment the below line if the shit ain't working
//#include <stdlib.h>
int health = 100;
int armor = 0;
void main() {
startGame(); // Begin game!
return 0; // Shit closed successfully
}
void startGame() {
char input; // Only one character in size.
printf(" Text Adventure Game! \n");
printf("You are in a dark room. Your hands are binded. What do you do? \n");
printf("(S)ay 'help!' | (B)reak your bonds | (C)ommit Adultery :>");
scanf("%c",&input); // Pointer for input (determined to be a char by %c)
// Input check
if(input == 's') {
write("You shout for help, but nobody hears you. \n");
write("You slowly starve to death. \n");
update(0,0);
blinkGameOver();
return;
}
if(input == 'b') {
write("As hard as you can, you struggle to break free from the bonds. \n");
write("You slowly starve to death. \n");
update(0,0);
blinkGameOver();
return;
}
if(input == 'c') {
write("Adultery is sinful. \n");
// Zap!
write("You were struck down by the lord. \n");
update(0,0);
blinkGameOver();
return;
}
}
void write(char input[]) { // The glorious write-it-out method.
int i; // Declare counter.
for(i=0;i<strlen(input);i++) {
printf("%c",input[i]);
if(i & 1) { // Every other character.
if(input[i] != " ") { // If the character is not a space.
beep();
}
}
usleep(50);
}
}
void update(int healthAmt, int armorAmt) {
usleep(1000);
health = healthAmt;
armor = armorAmt; // Set values equal to what is given.
if(health == 0) { // If the game is over, play this noise and print the text as the 'death beep' plays.
beep(); // Heart monitor sound.
usleep(500);
beep();
usleep(500);
beep();
usleep(500);
printf("\n HEALTH: %d \n",health);
beep();
flash();
}
else { // Otherwise, just show the health (and armor).
beep();
printf("\n HEALTH: %d \n",health);
}
if(armor > 0) {
printf("ARMOR: %d \n",armor);
}
}
void clearScreen() {
printf("\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n"); // Clear the screen.
// Note: clear-screen speed?
}
void blinkGameOver() {
int i; // Declare counter.
int i2; // Other counter.
printf(" "); // Prints without tapping.
write("GAME OVER \n");
usleep(1000);
for(i=0; i<1000; i++) {
for(i2=0; i2<10; i2++) {
printf(" GAME OVER \n");
clearScreen();
}
}
}
will add more shit later
Last edited by LEADER OF THE FREE WORLD on Wed May 13, 2015 5:46 pm; edited 2 times in total (Reason for editing : suck this dick)
LEADER OF THE FREE WORLD- UNSTOPPABLE
- Posts : 21233
money : 2147483634
bitches : -828
Join date : 2013-02-25
Age : 15
Location : worlds most dangerous hacker
Humor : bench 420 squat 420 deadlift 420
Re: OAKYHUB OPEN SOURCE SOFTWARE CENTER
mfw idiot ammy asks me to post source and doesnt even shit on java with me in the thread
LEADER OF THE FREE WORLD- UNSTOPPABLE
- Posts : 21233
money : 2147483634
bitches : -828
Join date : 2013-02-25
Age : 15
Location : worlds most dangerous hacker
Humor : bench 420 squat 420 deadlift 420
Re: OAKYHUB OPEN SOURCE SOFTWARE CENTER
can i run these in lunicks
admin- ETERNAL PRESIDENT OF THE REPUBLIC
- Posts : 41616
money : -420000486
bitches : -5361
Join date : 2012-11-18
Age : 27
Location : music is better than popping pills
Re: OAKYHUB OPEN SOURCE SOFTWARE CENTER
you can run the java one and the text adventure will run with the posix compliant sourcemrspurinization wrote:can i run these in lunicks
LEADER OF THE FREE WORLD- UNSTOPPABLE
- Posts : 21233
money : 2147483634
bitches : -828
Join date : 2013-02-25
Age : 15
Location : worlds most dangerous hacker
Humor : bench 420 squat 420 deadlift 420
Re: OAKYHUB OPEN SOURCE SOFTWARE CENTER
rtcity do u have the balls to compile it?
LEADER OF THE FREE WORLD- UNSTOPPABLE
- Posts : 21233
money : 2147483634
bitches : -828
Join date : 2013-02-25
Age : 15
Location : worlds most dangerous hacker
Humor : bench 420 squat 420 deadlift 420
Similar topics
» Microsoft Censors OpenOffice Download Links -- "the software company has sent several DMCA takedowns to Google, listing copies of its open source competitor Open Office as copyright infringements"
» Federal Courts claim "open source" software is dangerous because "it can be modified" ... (eff.org)
» open source
» DARPA gives the public a one-stop shop for its open-source code
» Russian ‘SOPA’ Anti-Piracy Body Under Investigation For Software Piracy -- "Pirated software from Adobe, Microsoft, Corel and Autodesk was found on their machines"
» Federal Courts claim "open source" software is dangerous because "it can be modified" ... (eff.org)
» open source
» DARPA gives the public a one-stop shop for its open-source code
» Russian ‘SOPA’ Anti-Piracy Body Under Investigation For Software Piracy -- "Pirated software from Adobe, Microsoft, Corel and Autodesk was found on their machines"
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum