Commits

baldur  committed 0144cba

first part

  • Participants

Comments (0)

Files changed (17)

+syntax: glob
+build/
+dist/
+#
+#  There exist several targets which are by default empty and which can be 
+#  used for execution of your targets. These targets are usually executed 
+#  before and after some main targets. They are: 
+#
+#     .build-pre:              called before 'build' target
+#     .build-post:             called after 'build' target
+#     .clean-pre:              called before 'clean' target
+#     .clean-post:             called after 'clean' target
+#     .clobber-pre:            called before 'clobber' target
+#     .clobber-post:           called after 'clobber' target
+#     .all-pre:                called before 'all' target
+#     .all-post:               called after 'all' target
+#     .help-pre:               called before 'help' target
+#     .help-post:              called after 'help' target
+#
+#  Targets beginning with '.' are not intended to be called on their own.
+#
+#  Main targets can be executed directly, and they are:
+#  
+#     build                    build a specific configuration
+#     clean                    remove built files from a configuration
+#     clobber                  remove all built files
+#     all                      build all configurations
+#     help                     print help mesage
+#  
+#  Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
+#  .help-impl are implemented in nbproject/makefile-impl.mk.
+#
+#  Available make variables:
+#
+#     CND_BASEDIR                base directory for relative paths
+#     CND_DISTDIR                default top distribution directory (build artifacts)
+#     CND_BUILDDIR               default top build directory (object files, ...)
+#     CONF                       name of current configuration
+#     CND_PLATFORM_${CONF}       platform name (current configuration)
+#     CND_ARTIFACT_DIR_${CONF}   directory of build artifact (current configuration)
+#     CND_ARTIFACT_NAME_${CONF}  name of build artifact (current configuration)
+#     CND_ARTIFACT_PATH_${CONF}  path to build artifact (current configuration)
+#     CND_PACKAGE_DIR_${CONF}    directory of package (current configuration)
+#     CND_PACKAGE_NAME_${CONF}   name of package (current configuration)
+#     CND_PACKAGE_PATH_${CONF}   path to package (current configuration)
+#
+# NOCDDL
+
+
+# Environment 
+MKDIR=mkdir
+CP=cp
+CCADMIN=CCadmin
+
+
+# build
+build: .build-post
+
+.build-pre:
+# Add your pre 'build' code here...
+
+.build-post: .build-impl
+# Add your post 'build' code here...
+
+
+# clean
+clean: .clean-post
+
+.clean-pre:
+# Add your pre 'clean' code here...
+
+.clean-post: .clean-impl
+# Add your post 'clean' code here...
+
+
+# clobber
+clobber: .clobber-post
+
+.clobber-pre:
+# Add your pre 'clobber' code here...
+
+.clobber-post: .clobber-impl
+# Add your post 'clobber' code here...
+
+
+# all
+all: .all-post
+
+.all-pre:
+# Add your pre 'all' code here...
+
+.all-post: .all-impl
+# Add your post 'all' code here...
+
+
+# build tests
+build-tests: .build-tests-post
+
+.build-tests-pre:
+# Add your pre 'build-tests' code here...
+
+.build-tests-post: .build-tests-impl
+# Add your post 'build-tests' code here...
+
+
+# run tests
+test: .test-post
+
+.test-pre:
+# Add your pre 'test' code here...
+
+.test-post: .test-impl
+# Add your post 'test' code here...
+
+
+# help
+help: .help-post
+
+.help-pre:
+# Add your pre 'help' code here...
+
+.help-post: .help-impl
+# Add your post 'help' code here...
+
+
+
+# include project implementation makefile
+include nbproject/Makefile-impl.mk
+
+# include project make variables
+include nbproject/Makefile-variables.mk
+#include "adventure.h"
+
+#include <malloc.h>
+#include <stdarg.h>
+#include <string.h>
+#include <stdio.h>
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+
+
+	Dialog mkDialog(enum TextColor color, const char *char_name, const char *message) {
+		Dialog dlg = { color, char_name, message };
+		return dlg;
+	}
+
+
+	Choice mkChoice(State state, const char *message) {
+		Choice choice = { state, message };
+		return choice;
+	}
+
+
+
+
+	void printMessage(const char *message, int indent, int delay_per_char) {
+		int textlen = strlen(message);
+		int cursor_pos = indent;
+		char last_char = '\0';
+
+		int i=0;
+		for(i=0; i<textlen; i++) {
+			char current_char  = message[i];
+			char char_to_print = '\0';
+			int do_newline = 0;
+
+			switch(current_char) {
+				case '\n': {
+					do_newline = 1;
+
+					// longer pause for paragraph
+					if (last_char == '\n') {
+						sleepMilliSeconds(500);
+					}
+
+					break;
+				}
+
+				case '&': {
+					int begin = i;
+
+					while(i < textlen && message[i] != ';') {
+						i++;
+					}
+
+					int size = i - begin;
+					char *code = malloc(size + 1);
+					memset(code, '\0', size + 1);
+					strncpy(code, &(message[begin]), size);
+
+					if (strcmp(code, "&Auml") == 0) {
+						char_to_print = '\x8E';
+					}
+
+					if (strcmp(code, "&Ouml") == 0) {
+						char_to_print = '\x99';
+					}
+
+					if (strcmp(code, "&Uuml") == 0) {
+						char_to_print = '\x9A';
+					}
+
+					if (strcmp(code, "&auml") == 0) {
+						char_to_print = '\x84';
+					}
+
+					if (strcmp(code, "&ouml") == 0) {
+						char_to_print = '\x94';
+					}
+
+					if (strcmp(code, "&uuml") == 0) {
+						char_to_print = '\x9A';
+					}
+
+					if (strcmp(code, "&szlig") == 0) {
+						char_to_print = '\xE1';
+					}
+
+				//	printf("||%c||%s||", char_to_print, code);
+
+					free(code);
+
+					break;
+				}
+
+				default: {
+					char_to_print = current_char;
+					break;
+				}
+			}
+
+			if (char_to_print) {
+				printf("%c", char_to_print);
+				sleepMilliSeconds(delay_per_char);
+				++cursor_pos;
+			}
+
+			if (do_newline || (cursor_pos >= 78)) {
+				printf("\n");
+
+				int j;
+				for(j=0; j<indent; j++) {
+					printf(" ");
+				}
+
+				cursor_pos = indent;
+			}
+
+			last_char = current_char;
+		}
+
+		return;
+	}
+
+
+	void playDialog(Dialog dlg) {
+		setTextColor(dlg.char_color, Black);
+		printf(dlg.char_name);
+
+		setTextColor(White, Black);
+		printf(": ");
+
+		int indent = 2 + strlen(dlg.char_name);
+		printMessage(dlg.message, indent, 30);
+
+		printf("\n\n");
+		sleepMilliSeconds(1000);
+
+		return;
+	}
+
+
+	State selectChoice(int num, ...) {
+		Choice **choices = malloc(num * sizeof(Choice*));
+		va_list args;
+		va_start(args, num);
+
+		int i;
+		for(i=0; i<num; i++) {
+			Choice *c = va_arg(args, Choice*);
+			choices[i] = c;
+		}
+
+		// print all choices
+		setTextColor(Pink, Black);
+
+		for(i=0; i<num; i++) {
+			printf(" [%d] ", (i+1));
+			printMessage(choices[i]->title, 5, 0);
+			printf("\n");
+		}
+
+		// short delay to prevent accidental keypresses
+		sleepMilliSeconds(200);
+		Choice *selected_choice = NULL;
+		int selected = 0;
+
+		do {
+			int value = (getch() - '0' - 1);
+
+			if (value >= 0 && value < num) {
+				selected = value;
+				selected_choice = choices[selected];
+				break;
+			}
+		}
+		while(1);
+
+		unsigned short x;
+		unsigned short y;
+		getCursorPosition(&x, &y);
+		setCursorPosition(0, y - num + selected);
+
+		setTextColor(White, Pink);
+		printf(" [%d] ", (selected + 1));
+		printMessage(selected_choice->title, 5, 0);
+
+		// wait a moment
+		sleepMilliSeconds(300);
+
+		// clear the choice selection
+		setTextColor(White, Black);
+		for(i=0; i<num; i++) {
+			setCursorPosition(0, y - num + i);
+			printf("                                                                                ");
+		}
+
+		// reset cursor position
+		setCursorPosition(0, y - 2);
+
+		va_end(args);
+		free(choices);
+
+		return selected_choice->state;
+	}
+
+
+#ifdef	__cplusplus
+}
+#endif
+/* 
+ * File:   adventure.h
+ * Author: Baldur
+ *
+ * Created on 23. September 2012, 03:19
+ */
+
+#ifndef ADVENTURE_H
+#define	ADVENTURE_H
+
+#include "console.h"
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+
+	typedef unsigned int State;
+
+
+	typedef struct {
+		enum TextColor	char_color;
+		const char*		char_name;
+		const char*		message;
+
+	} Dialog;
+
+
+
+	typedef struct {
+		State			state;
+		const char*		title;
+
+	} Choice;
+
+
+
+	Dialog mkDialog(enum TextColor color, const char *char_name, const char *mnessage);
+	Choice mkChoice(State state, const char *message);
+
+
+
+	void playDialog(Dialog dlg);
+
+
+
+	State selectChoice(int num, ...);
+
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif	/* ADVENTURE_H */
+
+#include "console.h"
+
+#if _WIN32
+#include <windows.h>
+#endif
+
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+
+	void clearScreen() {
+		#ifdef _WIN32
+			HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
+			COORD coord = {0, 0};
+			DWORD count;
+			CONSOLE_SCREEN_BUFFER_INFO csbi;
+			GetConsoleScreenBufferInfo(hStdOut, &csbi);
+			FillConsoleOutputCharacter(hStdOut, ' ',
+									   csbi.dwSize.X * csbi.dwSize.Y,
+									   coord, &count);
+			SetConsoleCursorPosition(hStdOut, coord);
+		#else
+			#error Unknown Platform
+		#endif
+	}
+
+
+	void setCursorVisible(int visible) {
+		#if _WIN32
+			CONSOLE_CURSOR_INFO ci = {10, visible ? TRUE : FALSE};
+			SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &ci);
+		#else
+			#error Unknown Platform
+		#endif
+	}
+
+
+	void disableConsoleScrolling() {
+		#if _WIN32
+			HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
+			COORD size = {80, 23};
+			SetConsoleScreenBufferSize(hStdOut, size);
+		#else
+			#error Unknown Platform
+		#endif
+	}
+
+
+	void setCursorPosition(unsigned short x, unsigned short y) {
+		#if _WIN32
+			COORD coords = { x, y };
+			SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE) , coords);
+		#else
+			#error Unknown Platform
+		#endif
+	}
+
+
+	void getCursorPosition(unsigned short* x, unsigned short* y) {
+		#if _WIN32
+			HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
+			CONSOLE_SCREEN_BUFFER_INFO SBInfo;
+			GetConsoleScreenBufferInfo(hStdOut, &SBInfo);
+
+			(*x) = SBInfo.dwCursorPosition.X;
+			(*y) = SBInfo.dwCursorPosition.Y;
+		#else
+			#error Unknown Platform
+		#endif
+	}
+
+
+	void setTextColor(enum TextColor foreground, enum TextColor background) {
+		#if _WIN32
+			WORD color = (background << 4) + (foreground);
+			SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color);
+		#else
+			#error Unknown Platform
+		#endif
+	}
+
+
+
+	void sleepSeconds(int seconds) {
+		#if _WIN32
+			Sleep(seconds * 1000);
+		#else
+			#error Unknown Platform
+		#endif
+	}
+
+
+	void sleepMilliSeconds(int ms) {
+		#if _WIN32
+			Sleep(ms);
+		#else
+			#error Unknown Platform
+		#endif
+	}
+
+
+
+#ifdef	__cplusplus
+}
+#endif
+/* 
+ * File:   console.h
+ * Author: Baldur
+ *
+ * Created on 22. September 2012, 16:32
+ */
+
+#ifndef CONSOLE_H
+#define	CONSOLE_H
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+
+	enum TextColor {
+		Black,
+		DarkBlue,
+		DarkGreen,
+		DarkCyan,
+		DarkRed,
+		DarkMagenta,
+		DarkYellow,
+		LightGray,
+		DarkGray,
+		LightBlue,
+		LightGreen,
+		LightCyan,
+		LightRed,
+		LightMagenta,
+		LightYellow,
+		White,
+
+
+		Blue		= DarkBlue,
+		Green		= DarkGreen,
+		Red			= DarkRed,
+		Magenta		= DarkMagenta,
+		Pink		= LightMagenta,
+		Brown		= DarkYellow,
+		Yellow		= LightYellow,
+		Cyan		= LightCyan,
+	};
+
+
+
+	void clearScreen();
+
+
+	void setCursorVisible(int visible);
+
+
+	void disableConsoleScrolling();
+
+
+	void setCursorPosition(unsigned short x, unsigned short y);
+
+
+	void getCursorPosition(unsigned short *x, unsigned short *y);
+
+
+	void setTextColor(enum TextColor foreground, enum TextColor background);
+
+
+	void sleepSeconds(int seconds);
+	void sleepMilliSeconds(int seconds);
+
+
+	char waitForKey();
+
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif	/* CONSOLE_H */
+
+#include "cutscenes.h"
+#include "console.h"
+
+#include <stdio.h>
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+
+#define CHR_LINE_UD		'\xB3'
+#define CHR_LINE_LR		'\xC4'
+#define CHR_LINE_UL		'\xD9'
+#define CHR_LINE_UR		'\xC0'
+#define CHR_LINE_DL		'\xBF'
+#define CHR_LINE_DR		'\xDA'
+#define CHR_LINE_ULR	'\xC1'
+#define CHR_LINE_UDR	'\xC3'
+#define CHR_LINE_UDL	'\xB4'
+#define CHR_LINE_DLR	'\xC2'
+#define CHR_LINE_UDLR	'\xC5'
+
+
+	void printC(unsigned short x, unsigned short y, char c) {
+		setCursorPosition(x, y);
+		printf("%c", c);
+	}
+
+
+	void printCharacter(unsigned int x, unsigned int y) {
+		setCursorPosition(x-1, y-3);	printf(" O ");
+		setCursorPosition(x-1, y-2);	printf("-|-");
+		setCursorPosition(x-1, y-1);	printf(" | ");
+		setCursorPosition(x-1, y-0);	printf("/ \\");
+	}
+
+
+	void printShop() {
+		int i;
+
+		setTextColor(Brown, Black);
+
+		for(i=0; i<80; i++) {
+			printC(i, 17, CHR_LINE_LR);
+		}
+
+		// board
+		setCursorPosition(14, 17);
+		printf("%c   %c", CHR_LINE_UL, CHR_LINE_UR);
+		setCursorPosition(14, 16);
+		printf("%c   %c", CHR_LINE_UD, CHR_LINE_UD);
+		setCursorPosition(14, 15);
+		printf("%c%c%c%c%c", CHR_LINE_DR, CHR_LINE_LR, CHR_LINE_LR, CHR_LINE_LR, CHR_LINE_DL);
+
+		// door
+		printC(50, 17, CHR_LINE_ULR);
+		printC(55, 17, CHR_LINE_ULR);
+
+		for(i=12; i<17; i++) {
+			printC(50, i, CHR_LINE_UD);
+			printC(55, i, CHR_LINE_UD);
+		}
+
+		printC(50, 15, CHR_LINE_UDR);
+
+		setCursorPosition(50, 11);
+		printf("%c%c%c%c%c%c", CHR_LINE_DR, CHR_LINE_LR, CHR_LINE_LR, CHR_LINE_LR, CHR_LINE_LR, CHR_LINE_DL);
+
+		// apple logo - shining white!
+		setTextColor(White, Black);
+		setCursorPosition(30,  2);		printf("_");
+		setCursorPosition(30,  3);		printf("\\|__  ___");
+		setCursorPosition(30,  4);		printf(" /  \\/  /");
+		setCursorPosition(30,  5);		printf("/      |");
+		setCursorPosition(30,  6);		printf("|       \\");
+		setCursorPosition(30,  7);		printf("|        |");
+		setCursorPosition(30,  8);		printf("\\        /");
+		setCursorPosition(30,  9);		printf(" \\______/");
+	}
+
+
+
+	void playCutsceneIntro() {
+		clearScreen();
+		printShop();
+
+		setTextColor(Cyan, Black);
+		printCharacter(12, 16);
+
+		int i;
+		for(i=0; i<28; i++) {
+			setTextColor(Green, Black);
+			printCharacter(48 - i, 16);
+
+			sleepMilliSeconds(100);
+
+			if (i != 27) {
+				int j;
+				for(j=12; j<=16; j++) {
+					setCursorPosition(48 - i - 1, j);
+					printf("   ");
+				}
+			}
+		}
+
+		setCursorPosition(0, 20);
+	}
+
+
+
+	playCutsceneOutro_JustGoing(Dialog dlg) {
+		clearScreen();
+		printShop();
+
+		setTextColor(Cyan, Black);
+		printCharacter(12, 16);
+
+		setTextColor(Green, Black);
+		printCharacter(21, 16);
+
+		setCursorPosition(0, 19);
+		playDialog(dlg);
+
+		// leaving animation
+		int i;
+		for(i=0; i<28; i++) {
+			setTextColor(Green, Black);
+			printCharacter(21 + i, 16);
+
+			sleepMilliSeconds(100);
+
+			int j;
+			for(j=12; j<=16; j++) {
+				setCursorPosition(21 + i - 1, j);
+				printf("   ");
+			}
+		}
+
+		setCursorPosition(0, 20);
+	}
+
+
+
+
+	playCutsceneOutro_CallMeAnAmbulance() {
+		int t;
+		for(t=0; t<4; t++) {
+			clearScreen();
+			printShop();
+
+			setTextColor(Cyan, Black);
+			printCharacter(12, 16);
+
+			setTextColor(Green, Black);
+
+			switch(t) {
+				case 0: {
+					printCharacter(21, 16);
+					break;
+				}
+
+				case 1: {
+					printCharacter(30, 16);
+					break;
+				}
+
+				case 2: {
+					printCharacter(39, 16);
+					break;
+				}
+
+				case 3: {
+					printCharacter(48, 16);
+					break;
+				}
+			}
+
+			setCursorPosition(0, 19);
+			
+			switch(t) {
+				case 0: {
+					Dialog dlg = { Green, "Kunde",
+									"Nun, ich glaube es ist besser, ich gehe jetzt."
+					};
+
+					playDialog(dlg);
+
+					break;
+				}
+
+				case 1: {
+					Dialog dlg = { Green, "Kunde",
+									"Ich werde ein anderes "
+									"Mobilfunktelefonfachgesch&auml;ft aufsuchen."
+					};
+
+					playDialog(dlg);
+
+					break;
+				}
+				case 2: {
+					Dialog dlg = { Green, "Kunde",
+									"Und dort ein neues Mobilfunktelefon erwerben."
+					};
+
+					playDialog(dlg);
+
+					break;
+				}
+				case 3: {
+					Dialog dlg = { Green, "Kunde",
+									"Dann kann ich Hilfe f&uuml;r sie rufen.\n"
+									"Warten Sie einfach solange hier."
+					};
+
+					playDialog(dlg);
+
+					break;
+				}
+			}
+		}
+
+		setCursorPosition(0, 23);
+	}
+
+
+#ifdef	__cplusplus
+}
+#endif
+
+/* 
+ * File:   cutscenes.h
+ * Author: Baldur
+ *
+ * Created on 23. September 2012, 00:33
+ */
+
+#ifndef CUTSCENES_H
+#define	CUTSCENES_H
+
+#include "adventure.h"
+
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+	void playCutsceneIntro();
+
+	void playCutsceneOutro_JustGoing(Dialog dlg);
+	void playCutsceneOutro_CallMeAnAmbulance();
+
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif	/* CUTSCENES_H */
+
+/* 
+ * File:   main.c
+ * Author: Baldur
+ *
+ * Created on 22. September 2012, 16:18
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+
+#include "console.h"
+#include "cutscenes.h"
+#include "adventure.h"
+
+
+
+#define DLG_SJ			Cyan, "Stefan J."
+#define DLG_CUST		Green, "Kunde"
+
+
+
+
+enum {
+	Adv_Beginning,
+		Adv_Sorry_Hamwanich,
+		Adv_Sorry_Gemuesetheke,
+		Adv_OfferEiFon,
+
+	Adv_Presenting_EiFon,
+		Adv_Presenting_EiFon_TheNEWeiFon,
+		Adv_Presenting_EiFon_FromTheFuhrer,
+		Adv_Presenting_EiFon_SoBeautyful,
+
+	Adv_Customer_Decision,
+
+	Adv_Customer_WantsLTE,
+	Adv_Customer_WantsLTE_Arguments,
+	Adv_Customer_WantsLTE_Arg_Radiation,
+	Adv_Customer_WantsLTE_Arg_NotSupportedByServers,
+	Adv_Customer_WantsLTE_Arg_GetALife,
+
+	Adv_Customer_WantsBiggerScreen,
+	Adv_Customer_WantsBiggerScreen_Arguments,
+
+	Adv_Customer_WantsFasterCPU,
+	Adv_Customer_WantsFasterCPU_Arguments,
+
+	Adv_Customer_WantsToBuy,
+
+	Adv_Customer_Leaves,
+};
+
+
+
+
+
+
+/*
+ * 
+ */
+int main(int argc, char** arg) {
+	State state = Adv_Beginning;
+
+	// initialize random number generator
+	srand(time(NULL));
+
+	int the_NEW_eiFon_count				= 0;
+	int fuehrer_argument_used			= 0;
+	int customer_wants_lte				= 1;
+	int customer_wants_faster_cpu		= 1;
+	int customer_wants_bigger_screen	= 1;
+
+	int lte_arg_radiation_used			= 0;
+	int lte_arg_serversupport_used		= 0;
+
+	// make the cursor disappearing
+	setCursorVisible(0);
+	disableConsoleScrolling();
+	
+	playCutsceneIntro();
+
+	do {
+		switch(state) {
+			//<editor-fold defaultstate="collapsed" desc=" Intro ">
+			case Adv_Beginning: {
+				Dialog dlg = { Cyan, "Stefan J",
+								"Einen sch&ouml;nen guten Tag, mein Herr.\nWie kann ich behilflich sein?" }
+				;
+
+				Dialog dlg2 = { Green, "Ein potentieller Kunde",
+								"Meinen Gru&szlig;, werter Herr Mobilfunktelefon-\nfachverk&auml;ufer!\n\n"
+								"Ich w&auml;re an dem Erwerb eines neuen Mobilfunktelefons\ninteressiert." }
+				;
+
+				playDialog(dlg);
+				playDialog(dlg2);
+
+				Choice a = { Adv_Sorry_Hamwanich,    "Tut mir leid, so etwas gibt es hier nicht." };
+				Choice b = { Adv_Sorry_Gemuesetheke, "Tut mir leid, das hier ist die Gem&uuml;setheke." };
+				Choice c = { Adv_OfferEiFon,         "Ich hab hier was f&uuml;r Sie." };
+				state = selectChoice(3, &a, &b, &c);
+
+				break;
+			}
+
+			case Adv_Sorry_Hamwanich: {
+				Dialog dlg = { DLG_SJ, "Tut mir leid, derartige Ware f&uuml;hren wir hier nicht." };
+				playDialog(dlg);
+
+				state = Adv_Customer_Leaves;
+
+				break;
+			}
+
+			case Adv_Sorry_Gemuesetheke: {
+				Dialog dlg = { DLG_SJ, "Tut mir leid, hier ist die Gem&uuml;setheke.\n"
+										"Versuchen Sie es später noch einmal."
+				};
+				playDialog(dlg);
+
+				state = Adv_Customer_Leaves;
+
+				break;
+			}
+				
+			case Adv_Customer_Leaves: {
+				sleepSeconds(1);
+
+				Dialog dlg = { Green, "Kunde",
+								"Oh, wenn das so ist, suche ich woanders mein Gl&uuml;ck.\n"
+								"Auf wiedersehen."
+				};
+
+				playCutsceneOutro_JustGoing(dlg);
+
+				return (EXIT_FAILURE);
+			}
+
+			case Adv_OfferEiFon: {
+				Dialog dlg1 = { DLG_SJ,
+								"Ah! Hier sind Sie genau richtig!\n\n"
+								"Wir haben hier das neue eiFon, welches soeben frisch in diesen\n"
+								"bescheidenen Laden geliefert wurde.\n"
+								"Es gibt derzeit nichts vergleichbares auf der Welt."
+				};
+
+				Dialog dlg2 = { DLG_CUST,
+								"Mein Herr, sie belieben zu scherzen?\n"
+								"Ich glaube kaum, da&szlig; dieses Ger&auml;t meinen "
+								"Anforderungen gerecht werden\nk&ouml;nnte."
+				};
+
+				playDialog(dlg1);
+				playDialog(dlg2);
+
+				state = Adv_Presenting_EiFon;
+
+				break;
+			}
+
+			case Adv_Presenting_EiFon: {
+				Choice c1 = { Adv_Presenting_EiFon_TheNEWeiFon,
+								"Es ist das NEUE eiFon!"
+				};
+				Choice c2 = { Adv_Presenting_EiFon_FromTheFuhrer,
+								"Dieses eiFon wurde von unserem F&uuml;hrer "
+								"h&ouml;chstpers&ouml;nlich angefertigt."
+				};
+				Choice c3 = { Adv_Presenting_EiFon_SoBeautyful,
+								"Dieses eiFon besticht durch seine Sch&ouml;nheit und Eleganz."
+				};
+
+				if (fuehrer_argument_used) {
+					state = selectChoice(2, &c1, &c3);
+				}
+				else {
+					state = selectChoice(3, &c1, &c2, &c3);
+				}
+
+				break;
+			}
+
+			case Adv_Presenting_EiFon_FromTheFuhrer: {
+				// this option resets the NEW eiFon counter.
+				the_NEW_eiFon_count = 0;
+
+				// the fuehrer argument cannot be used any more.
+				fuehrer_argument_used = 1;
+
+				Dialog dlg1 = { DLG_SJ,
+								"Dieses eiFon wurde von unserem F&uuml;hrer "
+								"h&ouml;chstpers&ouml;nlich angefertigt.\n\n"
+								"Es tr&auml;gt den Geist des Gro&szlig;en Meisters in sich.\n\n"
+								"*ein Scheinwerfer wirft dabei einen markanten Lichtkegel auf das\neiFon herab*"
+				};
+
+				Dialog dlg2 = { DLG_CUST,
+								"Ah... gewiss...\n"
+								"*Der Kunde betrachtet einen Moment lang das eiFon "
+								"mit einem and&auml;chtigem Blick*\n\n"
+								"Doch was kann mir dieses Ger&auml;t nun bieten, "
+								"damit ich einen Kauf in\n"
+								"Erw&auml;gung ziehen k&ouml;nnte?"
+				};
+
+				playDialog(dlg1);
+				playDialog(dlg2);
+
+				state = Adv_Presenting_EiFon;
+
+				break;
+			}
+
+			case Adv_Presenting_EiFon_TheNEWeiFon: {
+				++the_NEW_eiFon_count;
+
+				state = Adv_Presenting_EiFon;
+
+				Dialog dlg1 = { DLG_SJ,
+								"Es ist das NEUE eiFon!"
+				};
+
+				playDialog(dlg1);
+
+				switch(the_NEW_eiFon_count) {
+					case 1: {
+						Dialog dlg2 = { DLG_CUST,
+										"Ja.. gewiss ist es besser als das alte, aber..."
+						};
+
+						playDialog(dlg2);
+
+						break;
+					}
+
+					case 2: {
+						Dialog dlg2 = { DLG_CUST,
+										"Nun, das sagten Sie bereits..."
+						};
+
+						playDialog(dlg2);
+
+						break;
+					}
+
+					case 3: {
+						Dialog dlg2 = { DLG_CUST,
+										"Ich verstehe, aber was sind Ihre Argumente?"
+						};
+
+						playDialog(dlg2);
+
+						break;
+					}
+
+					case 4: {
+						Dialog dlg2 = { DLG_CUST,
+										"Mein Herr, Sie scheinen mir reichlich verwirrt."
+						};
+
+						playDialog(dlg2);
+
+						break;
+					}
+
+					case 5: {
+						playCutsceneOutro_CallMeAnAmbulance();
+						return (EXIT_FAILURE);
+					}
+				}
+
+				break;
+			}
+
+			case Adv_Presenting_EiFon_SoBeautyful: {
+				Dialog dlg1 = { DLG_SJ,
+								"Dieses eiFon besticht durch seine Sch&ouml;nheit und Eleganz.\n"
+								"Durch dieses Kunstwerk werden Sie sich von der Masse an ordin&auml;ren\n"
+								"Mobilfunktelefonen abheben und der Mittelpunkt eines jeden\n"
+								"gesellschaftlichen Ereignisses darstellen."
+				};
+
+				Dialog dlg2 = { DLG_CUST,
+								"Ja, da haben Sie recht.\n"
+								"Ich will ja schlie&szlig;lich auch mit einem ganz besonderem Exemplar "
+								"meinen individuellen Geschmack ausdr&uuml;cken."
+				};
+
+				playDialog(dlg1);
+				playDialog(dlg2);
+
+				state = Adv_Customer_Decision;
+
+				break;
+			}
+
+			case Adv_Customer_Decision: {
+				State possibilities[10];
+				int poss_count = 0;
+
+				if (customer_wants_lte) {
+					possibilities[poss_count] = Adv_Customer_WantsLTE;
+					++poss_count;
+				}
+
+			//	if (customer_wants_bigger_screen) {
+			//		possibilities[poss_count] = Adv_Customer_WantsBiggerScreen;
+			//		++poss_count;
+			//	}
+
+			//	if (customer_wants_faster_cpu) {
+			//		possibilities[poss_count] = Adv_Customer_WantsFasterCPU;
+			//		++poss_count;
+			//	}
+
+				if (poss_count) {
+					int r = abs(rand()) % poss_count;
+					state = possibilities[r];
+				}
+				else {
+					state = Adv_Customer_WantsToBuy;
+				}
+
+				break;
+			}
+			//</editor-fold>
+
+			//<editor-fold defaultstate="collapsed" desc=" Customer wants LTE ">
+			case Adv_Customer_WantsLTE: {
+				Dialog dlg1 = { DLG_CUST,
+								"Nun, ich hoffe, dieses Ger&auml;t ist auch in der Lage, "
+								"mit Hilfe der neuesten Mobilfunktechnologien zu kommunizieren, "
+								"damit ich auch am gesellschaftlichen Leben teilnehmen "
+								"und mich mit meinen Kontakten unterhalten kann."
+				};
+
+				playDialog(dlg1);
+				state = Adv_Customer_WantsLTE_Arguments;
+
+				break;
+			}
+
+			case Adv_Customer_WantsLTE_Arguments: {
+				Choice c1 = { Adv_Customer_WantsLTE_Arg_Radiation,
+								"Denken Sie an die gef&auml;hrliche Strahlung."
+				};
+
+				Choice c2 = { Adv_Customer_WantsLTE_Arg_NotSupportedByServers,
+								"Bedenken Sie, da&szlig; viele Server das gar nicht unterst&uuml;tzen."
+				};
+
+				Choice c3 = { Adv_Customer_WantsLTE_Arg_GetALife,
+								"Es gibt auch ein Leben au&szlig;erhalb des Internets."
+				};
+
+				break;
+			}
+			//</editor-fold>
+
+			case Adv_Customer_WantsToBuy: {
+				printf("almost won...");
+				return (EXIT_SUCCESS);
+				break;
+			}
+		}
+	}
+	while(1);
+
+	return (EXIT_SUCCESS);
+}
+

File nbproject/Makefile-Debug.mk

+#
+# Generated Makefile - do not edit!
+#
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a -pre and a -post target defined where you can add customized code.
+#
+# This makefile implements configuration specific macros and targets.
+
+
+# Environment
+MKDIR=mkdir
+CP=cp
+GREP=grep
+NM=nm
+CCADMIN=CCadmin
+RANLIB=ranlib
+CC=gcc.exe
+CCC=g++.exe
+CXX=g++.exe
+FC=gfortran
+AS=as.exe
+
+# Macros
+CND_PLATFORM=MinGW_1-Windows
+CND_DLIB_EXT=dll
+CND_CONF=Debug
+CND_DISTDIR=dist
+CND_BUILDDIR=build
+
+# Include project Makefile
+include Makefile
+
+# Object Directory
+OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}
+
+# Object Files
+OBJECTFILES= \
+	${OBJECTDIR}/cutscenes.o \
+	${OBJECTDIR}/console.o \
+	${OBJECTDIR}/adventure.o \
+	${OBJECTDIR}/main.o
+
+
+# C Compiler Flags
+CFLAGS=
+
+# CC Compiler Flags
+CCFLAGS=
+CXXFLAGS=
+
+# Fortran Compiler Flags
+FFLAGS=
+
+# Assembler Flags
+ASFLAGS=
+
+# Link Libraries and Options
+LDLIBSOPTIONS=
+
+# Build Targets
+.build-conf: ${BUILD_SUBPROJECTS}
+	"${MAKE}"  -f nbproject/Makefile-${CND_CONF}.mk ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/jobs.exe
+
+${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/jobs.exe: ${OBJECTFILES}
+	${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}
+	${LINK.c} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/jobs ${OBJECTFILES} ${LDLIBSOPTIONS} 
+
+${OBJECTDIR}/cutscenes.o: cutscenes.c 
+	${MKDIR} -p ${OBJECTDIR}
+	${RM} $@.d
+	$(COMPILE.c) -g -MMD -MP -MF $@.d -o ${OBJECTDIR}/cutscenes.o cutscenes.c
+
+${OBJECTDIR}/console.o: console.c 
+	${MKDIR} -p ${OBJECTDIR}
+	${RM} $@.d
+	$(COMPILE.c) -g -MMD -MP -MF $@.d -o ${OBJECTDIR}/console.o console.c
+
+${OBJECTDIR}/adventure.o: adventure.c 
+	${MKDIR} -p ${OBJECTDIR}
+	${RM} $@.d
+	$(COMPILE.c) -g -MMD -MP -MF $@.d -o ${OBJECTDIR}/adventure.o adventure.c
+
+${OBJECTDIR}/main.o: main.c 
+	${MKDIR} -p ${OBJECTDIR}
+	${RM} $@.d
+	$(COMPILE.c) -g -MMD -MP -MF $@.d -o ${OBJECTDIR}/main.o main.c
+
+# Subprojects
+.build-subprojects:
+
+# Clean Targets
+.clean-conf: ${CLEAN_SUBPROJECTS}
+	${RM} -r ${CND_BUILDDIR}/${CND_CONF}
+	${RM} ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/jobs.exe
+
+# Subprojects
+.clean-subprojects:
+
+# Enable dependency checking
+.dep.inc: .depcheck-impl
+
+include .dep.inc

File nbproject/Makefile-Release.mk

+#
+# Generated Makefile - do not edit!
+#
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a -pre and a -post target defined where you can add customized code.
+#
+# This makefile implements configuration specific macros and targets.
+
+
+# Environment
+MKDIR=mkdir
+CP=cp
+GREP=grep
+NM=nm
+CCADMIN=CCadmin
+RANLIB=ranlib
+CC=gcc.exe
+CCC=g++.exe
+CXX=g++.exe
+FC=gfortran
+AS=as.exe
+
+# Macros
+CND_PLATFORM=MinGW_1-Windows
+CND_DLIB_EXT=dll
+CND_CONF=Release
+CND_DISTDIR=dist
+CND_BUILDDIR=build
+
+# Include project Makefile
+include Makefile
+
+# Object Directory
+OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}
+
+# Object Files
+OBJECTFILES= \
+	${OBJECTDIR}/cutscenes.o \
+	${OBJECTDIR}/console.o \
+	${OBJECTDIR}/adventure.o \
+	${OBJECTDIR}/main.o
+
+
+# C Compiler Flags
+CFLAGS=
+
+# CC Compiler Flags
+CCFLAGS=
+CXXFLAGS=
+
+# Fortran Compiler Flags
+FFLAGS=
+
+# Assembler Flags
+ASFLAGS=
+
+# Link Libraries and Options
+LDLIBSOPTIONS=
+
+# Build Targets
+.build-conf: ${BUILD_SUBPROJECTS}
+	"${MAKE}"  -f nbproject/Makefile-${CND_CONF}.mk ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/jobs.exe
+
+${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/jobs.exe: ${OBJECTFILES}
+	${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}
+	${LINK.c} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/jobs ${OBJECTFILES} ${LDLIBSOPTIONS} 
+
+${OBJECTDIR}/cutscenes.o: cutscenes.c 
+	${MKDIR} -p ${OBJECTDIR}
+	${RM} $@.d
+	$(COMPILE.c) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/cutscenes.o cutscenes.c
+
+${OBJECTDIR}/console.o: console.c 
+	${MKDIR} -p ${OBJECTDIR}
+	${RM} $@.d
+	$(COMPILE.c) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/console.o console.c
+
+${OBJECTDIR}/adventure.o: adventure.c 
+	${MKDIR} -p ${OBJECTDIR}
+	${RM} $@.d
+	$(COMPILE.c) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/adventure.o adventure.c
+
+${OBJECTDIR}/main.o: main.c 
+	${MKDIR} -p ${OBJECTDIR}
+	${RM} $@.d
+	$(COMPILE.c) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/main.o main.c
+
+# Subprojects
+.build-subprojects:
+
+# Clean Targets
+.clean-conf: ${CLEAN_SUBPROJECTS}
+	${RM} -r ${CND_BUILDDIR}/${CND_CONF}
+	${RM} ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/jobs.exe
+
+# Subprojects
+.clean-subprojects:
+
+# Enable dependency checking
+.dep.inc: .depcheck-impl
+
+include .dep.inc

File nbproject/Makefile-impl.mk

+# 
+# Generated Makefile - do not edit! 
+# 
+# Edit the Makefile in the project folder instead (../Makefile). Each target
+# has a pre- and a post- target defined where you can add customization code.
+#
+# This makefile implements macros and targets common to all configurations.
+#
+# NOCDDL
+
+
+# Building and Cleaning subprojects are done by default, but can be controlled with the SUB
+# macro. If SUB=no, subprojects will not be built or cleaned. The following macro
+# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf
+# and .clean-reqprojects-conf unless SUB has the value 'no'
+SUB_no=NO
+SUBPROJECTS=${SUB_${SUB}}
+BUILD_SUBPROJECTS_=.build-subprojects
+BUILD_SUBPROJECTS_NO=
+BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}}
+CLEAN_SUBPROJECTS_=.clean-subprojects
+CLEAN_SUBPROJECTS_NO=
+CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}}
+
+
+# Project Name
+PROJECTNAME=Jobs
+
+# Active Configuration
+DEFAULTCONF=Debug
+CONF=${DEFAULTCONF}
+
+# All Configurations
+ALLCONFS=Debug Release 
+
+
+# build
+.build-impl: .build-pre .validate-impl .depcheck-impl
+	@#echo "=> Running $@... Configuration=$(CONF)"
+	"${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf
+
+
+# clean
+.clean-impl: .clean-pre .validate-impl .depcheck-impl
+	@#echo "=> Running $@... Configuration=$(CONF)"
+	"${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf
+
+
+# clobber 
+.clobber-impl: .clobber-pre .depcheck-impl
+	@#echo "=> Running $@..."
+	for CONF in ${ALLCONFS}; \
+	do \
+	    "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf; \
+	done
+
+# all 
+.all-impl: .all-pre .depcheck-impl
+	@#echo "=> Running $@..."
+	for CONF in ${ALLCONFS}; \
+	do \
+	    "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf; \
+	done
+
+# build tests
+.build-tests-impl: .build-impl .build-tests-pre
+	@#echo "=> Running $@... Configuration=$(CONF)"
+	"${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-tests-conf
+
+# run tests
+.test-impl: .build-tests-impl .test-pre
+	@#echo "=> Running $@... Configuration=$(CONF)"
+	"${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .test-conf
+
+# dependency checking support
+.depcheck-impl:
+	@echo "# This code depends on make tool being used" >.dep.inc
+	@if [ -n "${MAKE_VERSION}" ]; then \
+	    echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \
+	    echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \
+	    echo "include \$${DEPFILES}" >>.dep.inc; \
+	    echo "endif" >>.dep.inc; \
+	else \
+	    echo ".KEEP_STATE:" >>.dep.inc; \
+	    echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \
+	fi
+
+# configuration validation
+.validate-impl:
+	@if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
+	then \
+	    echo ""; \
+	    echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \
+	    echo "See 'make help' for details."; \
+	    echo "Current directory: " `pwd`; \
+	    echo ""; \
+	fi
+	@if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
+	then \
+	    exit 1; \
+	fi
+
+
+# help
+.help-impl: .help-pre
+	@echo "This makefile supports the following configurations:"
+	@echo "    ${ALLCONFS}"
+	@echo ""
+	@echo "and the following targets:"
+	@echo "    build  (default target)"
+	@echo "    clean"
+	@echo "    clobber"
+	@echo "    all"
+	@echo "    help"
+	@echo ""
+	@echo "Makefile Usage:"
+	@echo "    make [CONF=<CONFIGURATION>] [SUB=no] build"
+	@echo "    make [CONF=<CONFIGURATION>] [SUB=no] clean"
+	@echo "    make [SUB=no] clobber"
+	@echo "    make [SUB=no] all"
+	@echo "    make help"
+	@echo ""
+	@echo "Target 'build' will build a specific configuration and, unless 'SUB=no',"
+	@echo "    also build subprojects."
+	@echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no',"
+	@echo "    also clean subprojects."
+	@echo "Target 'clobber' will remove all built files from all configurations and,"
+	@echo "    unless 'SUB=no', also from subprojects."
+	@echo "Target 'all' will will build all configurations and, unless 'SUB=no',"
+	@echo "    also build subprojects."
+	@echo "Target 'help' prints this message."
+	@echo ""
+

File nbproject/Makefile-variables.mk

+#
+# Generated - do not edit!
+#
+# NOCDDL
+#
+CND_BASEDIR=`pwd`
+CND_BUILDDIR=build
+CND_DISTDIR=dist
+# Debug configuration
+CND_PLATFORM_Debug=MinGW_1-Windows
+CND_ARTIFACT_DIR_Debug=dist/Debug/MinGW_1-Windows
+CND_ARTIFACT_NAME_Debug=jobs
+CND_ARTIFACT_PATH_Debug=dist/Debug/MinGW_1-Windows/jobs
+CND_PACKAGE_DIR_Debug=dist/Debug/MinGW_1-Windows/package
+CND_PACKAGE_NAME_Debug=jobs.tar
+CND_PACKAGE_PATH_Debug=dist/Debug/MinGW_1-Windows/package/jobs.tar
+# Release configuration
+CND_PLATFORM_Release=MinGW_1-Windows
+CND_ARTIFACT_DIR_Release=dist/Release/MinGW_1-Windows
+CND_ARTIFACT_NAME_Release=jobs
+CND_ARTIFACT_PATH_Release=dist/Release/MinGW_1-Windows/jobs
+CND_PACKAGE_DIR_Release=dist/Release/MinGW_1-Windows/package
+CND_PACKAGE_NAME_Release=jobs.tar
+CND_PACKAGE_PATH_Release=dist/Release/MinGW_1-Windows/package/jobs.tar
+#
+# include compiler specific variables
+#
+# dmake command
+ROOT:sh = test -f nbproject/private/Makefile-variables.mk || \
+	(mkdir -p nbproject/private && touch nbproject/private/Makefile-variables.mk)
+#
+# gmake command
+.PHONY: $(shell test -f nbproject/private/Makefile-variables.mk || (mkdir -p nbproject/private && touch nbproject/private/Makefile-variables.mk))
+#
+include nbproject/private/Makefile-variables.mk

File nbproject/Package-Debug.bash

+#!/bin/bash -x
+
+#
+# Generated - do not edit!
+#
+
+# Macros
+TOP=`pwd`
+CND_PLATFORM=MinGW_1-Windows
+CND_CONF=Debug
+CND_DISTDIR=dist
+CND_BUILDDIR=build
+NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
+TMPDIRNAME=tmp-packaging
+OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/jobs
+OUTPUT_BASENAME=jobs
+PACKAGE_TOP_DIR=jobs/
+
+# Functions
+function checkReturnCode
+{
+    rc=$?
+    if [ $rc != 0 ]
+    then
+        exit $rc
+    fi
+}
+function makeDirectory
+# $1 directory path
+# $2 permission (optional)
+{
+    mkdir -p "$1"
+    checkReturnCode
+    if [ "$2" != "" ]
+    then
+      chmod $2 "$1"
+      checkReturnCode
+    fi
+}
+function copyFileToTmpDir
+# $1 from-file path
+# $2 to-file path
+# $3 permission
+{
+    cp "$1" "$2"
+    checkReturnCode
+    if [ "$3" != "" ]
+    then
+        chmod $3 "$2"
+        checkReturnCode
+    fi
+}
+
+# Setup
+cd "${TOP}"
+mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
+rm -rf ${NBTMPDIR}
+mkdir -p ${NBTMPDIR}
+
+# Copy files and create directories and links
+cd "${TOP}"
+makeDirectory "${NBTMPDIR}/jobs/bin"
+copyFileToTmpDir "${OUTPUT_PATH}.exe" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}.exe" 0755
+
+
+# Generate tar file
+cd "${TOP}"
+rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/jobs.tar
+cd ${NBTMPDIR}
+tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/jobs.tar *
+checkReturnCode
+
+# Cleanup
+cd "${TOP}"
+rm -rf ${NBTMPDIR}

File nbproject/Package-Release.bash

+#!/bin/bash -x
+
+#
+# Generated - do not edit!
+#
+
+# Macros
+TOP=`pwd`
+CND_PLATFORM=MinGW_1-Windows
+CND_CONF=Release
+CND_DISTDIR=dist
+CND_BUILDDIR=build
+NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
+TMPDIRNAME=tmp-packaging
+OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/jobs
+OUTPUT_BASENAME=jobs
+PACKAGE_TOP_DIR=jobs/
+
+# Functions
+function checkReturnCode
+{
+    rc=$?
+    if [ $rc != 0 ]
+    then
+        exit $rc
+    fi
+}
+function makeDirectory
+# $1 directory path
+# $2 permission (optional)
+{
+    mkdir -p "$1"
+    checkReturnCode
+    if [ "$2" != "" ]
+    then
+      chmod $2 "$1"
+      checkReturnCode
+    fi
+}
+function copyFileToTmpDir
+# $1 from-file path
+# $2 to-file path
+# $3 permission
+{
+    cp "$1" "$2"
+    checkReturnCode
+    if [ "$3" != "" ]
+    then
+        chmod $3 "$2"
+        checkReturnCode
+    fi
+}
+
+# Setup
+cd "${TOP}"
+mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
+rm -rf ${NBTMPDIR}
+mkdir -p ${NBTMPDIR}
+
+# Copy files and create directories and links
+cd "${TOP}"
+makeDirectory "${NBTMPDIR}/jobs/bin"
+copyFileToTmpDir "${OUTPUT_PATH}.exe" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}.exe" 0755
+
+
+# Generate tar file
+cd "${TOP}"
+rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/jobs.tar
+cd ${NBTMPDIR}
+tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/jobs.tar *
+checkReturnCode
+
+# Cleanup
+cd "${TOP}"
+rm -rf ${NBTMPDIR}

File nbproject/configurations.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<configurationDescriptor version="84">
+  <logicalFolder name="root" displayName="root" projectFiles="true" kind="ROOT">
+    <logicalFolder name="HeaderFiles"
+                   displayName="Header Files"
+                   projectFiles="true">
+    </logicalFolder>
+    <logicalFolder name="ResourceFiles"
+                   displayName="Resource Files"
+                   projectFiles="true">
+    </logicalFolder>
+    <logicalFolder name="SourceFiles"
+                   displayName="Source Files"
+                   projectFiles="true">
+      <itemPath>adventure.c</itemPath>
+      <itemPath>adventure.h</itemPath>
+      <itemPath>console.c</itemPath>
+      <itemPath>console.h</itemPath>
+      <itemPath>cutscenes.c</itemPath>
+      <itemPath>cutscenes.h</itemPath>
+      <itemPath>main.c</itemPath>
+    </logicalFolder>
+    <logicalFolder name="TestFiles"
+                   displayName="Test Files"
+                   projectFiles="false"
+                   kind="TEST_LOGICAL_FOLDER">
+    </logicalFolder>
+    <logicalFolder name="ExternalFiles"
+                   displayName="Important Files"
+                   projectFiles="false"
+                   kind="IMPORTANT_FILES_FOLDER">
+      <itemPath>Makefile</itemPath>
+    </logicalFolder>
+  </logicalFolder>
+  <projectmakefile>Makefile</projectmakefile>
+  <confs>
+    <conf name="Debug" type="1">
+      <toolsSet>
+        <remote-sources-mode>LOCAL_SOURCES</remote-sources-mode>
+        <compilerSet>default</compilerSet>
+      </toolsSet>
+      <compileType>
+      </compileType>
+    </conf>
+    <conf name="Release" type="1">
+      <toolsSet>
+        <remote-sources-mode>LOCAL_SOURCES</remote-sources-mode>
+        <compilerSet>default</compilerSet>
+      </toolsSet>
+      <compileType>
+        <cTool>
+          <developmentMode>5</developmentMode>
+        </cTool>
+        <ccTool>
+          <developmentMode>5</developmentMode>
+        </ccTool>
+        <fortranCompilerTool>
+          <developmentMode>5</developmentMode>
+        </fortranCompilerTool>
+        <asmTool>
+          <developmentMode>5</developmentMode>
+        </asmTool>
+      </compileType>
+    </conf>
+  </confs>
+</configurationDescriptor>

File nbproject/project.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+    <type>org.netbeans.modules.cnd.makeproject</type>
+    <configuration>
+        <data xmlns="http://www.netbeans.org/ns/make-project/1">
+            <name>Jobs</name>
+            <c-extensions>c</c-extensions>
+            <cpp-extensions/>
+            <header-extensions>h</header-extensions>
+            <sourceEncoding>UTF-8</sourceEncoding>
+            <make-dep-projects/>
+            <sourceRootList/>
+            <confList>
+                <confElem>
+                    <name>Debug</name>
+                    <type>1</type>
+                </confElem>
+                <confElem>
+                    <name>Release</name>
+                    <type>1</type>
+                </confElem>
+            </confList>
+        </data>
+    </configuration>
+</project>