initial commit

This commit is contained in:
Sanders 2022-05-05 08:43:42 -06:00
commit 38dd144439
55 changed files with 3331 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -0,0 +1,16 @@
#include <stdio.h>
int main(void)
{
int i, j, n;
for (i = 0; i < 11; i++) {
for (j = 0; j < 10; j++) {
n = 10 * i + j;
if (n > 107) break;
printf("\033[%dm %3d\033[m", n, n);
}
printf("\n");
}
return 0;
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,6 @@
#include <stdio.h>
int main() {
printf("\033[5mA");
getch();
}

Binary file not shown.

BIN
everything else/blinktest.o Normal file

Binary file not shown.

View File

@ -0,0 +1,6 @@
#include <stdio.h>
int main() {
char esc[] = {'\033'};
printf("%c %d",esc[1],esc[1]);
}

Binary file not shown.

BIN
everything else/esc test.o Normal file

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,81 @@
.,**,,,,,,,.,*******/,/(,,**.,*#*/*/*,#(,/(/*////((*,***,/#/********///,(&&(*.,***,,,(/*/#(*/.,//##(/**///*///(#(*/*,**,***,**//(/*,****/(*(/, /(,(#///,.,/#%(/,**(###%%%%&&%&&&&&&&&&&&&&&&&&&&&&&%%&%&\n
,,,,,,,,.,,#*,...,(#(//#*.,,,//((%#,/(*/((,**,/*..*#%#/*//##/,,,/,,*/*******/////,,(***/,*##%(**///(((******,*///,,/#(///**(///*********,#%/.((,.*(#(/*,.**(.,((/(##%&%%%%%&&&&&&&&&&&&&&&&%&&&&&&%%%%&&\n
. ,,,,,,,,(%##/**,..,*,///*.(,,#%#,,,*//**#(*,,*(%%%%#/**/%,#/*//,,**/******/.,*/#*.. **/#/(#(((/,. **,***,*(///*/*#(/(((((/#**,,,,****,*/%*,,((#(,,/(**.,/(/,,((#%&&&&%%%%&&&&&&&&&&&&&&%%%&%&%&&&&&&&&\n
,,,.(#(**,(*,,,,***,***##,*//#%##,.,//.,*///(/,,,,,/(#%******//,////////***/*.*/*(*(#(((*%/,,./ ,/**/(/.**//##(//***/////**/(#(,.,.//***,###((/#/.*//#(/*,/**/%&%&%%%%%%%%%%%%%%&&&&&&&&&&%%%%%%&&&&&&&&\n
#**,,, .**,,*,,**,,*(%#////&/(((,*(/,*,/(*/**/((,,, .,//*/**,*/(/,*/*****,.,**(*,(*./(////,*//(*.,,/*(***/((/*.,(/,...**(/(#%%%*((*,,/(*#//(/(/.,//((/##(/(#%%%%%%%&&&&&&&&&&&%%%%&&&&&&&&&%&&&%%%&&&&&&\n
,.///******,*(**  .,*(#%%#%%(((/((**,.*/(((,,*//(##*,****/***/*/(.,,*/*/**,,*#/,*/*//((*,,*(//(//***/**,**/(/**,*/*#%(,,***/*,,,//#%##(/#//(/,(%,*(##/(%&/%%%%&%%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%&\n
*,*(/,**,***,**////%%(/((,.*///#/..*(#//*#///(#//(*//,**,****/**,//***/. .,,,*/*,.#%*,**(#/(#((##(///******,*****,***(####(/*,,,,*/*,(,*/*(#,.*&(,(###%%%%%%&&&&&&&&&&&&&@&&&&&&&&&&&&&@&&&&&&&&&&&&&&&&\n
,*,(/*,,//,,,,,*(/((/*. ,/////((##(*.*,/*#((,/(*,,,***/*,****,***,.,,,,***,,,,*/..*(/*..,**,**,**,,*,***/###%%#%(******/*((/((/**%&///%(,(/(#&%#&(%%%%%&%&%%&&&&&&&&&&&&&&&&&@@&&&&&&&&&@&&@@@@@@&&@@@&&\n
%*,/*,**/,,,(/,,,**/((//////(##/(#####%%%#(/(##//*,,,/*.***//,///**/(/*///..*(%&%*,***/**,,**,.,*////##(/*//*,/##(*,*/*,/*/((%%%(((/(*//*(((((%&&&&&%&&&&&&&&&&&&&&@@@&&&&&&%&&&&&&&&&&@@@@@@@@@@@@@&&@&\n
(%*(#*,*((****/(*,,*,,*****,,.. .*(..**/(#(***((#&@@#**/(((///***,///#*/,*/,.,**//*,,//..,,,,(/*//#%((####%%&&%%&&&%%#(/(###%%&%#%######%%#&&@@&@&&&&&&&&@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@&&&&&\n
,(%(%%%,*, .,(*..(/*,,,,,,,*//(((((*.**((#%@@@@@@@@@@@@@@@@@@&@@@@@#(/**(.(#/,/(/*(&(,//**/(/(#%%&&&&&&&&&&&&&&&&&&&&@@&%%&&&&@&&&&&@@&%&&&&&@@@&@@@&&&&&&&&&&@@&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@&&&&&&&\n
#%*,*(#(#((//,  ,,*.....,,,****/((#/,/(/(#&@@@@@@@&@@@@@@@@@@@@&&&&&&@@@@@%((//***////#%%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@&&&&&&&&&&@&&&&&%%&&&&@&&@@@@&&&&&&&&&@&&&&&&&&&&&&&&&&&&&%&&&&&&@@@@&&&&&&&&&\n
%/,.,*/##///((/*,*,.....**/#/((* ,(((*,**//&@@@@@@@@@@@@@@@@@@@@@@@@@&@@@&&&@@@@%%#%&&@&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@&&&&&&&&&&&&&&&&@@&&&&&&&&&&&@@@@@@&&&&&&&&@@&&&&&&&&&&&&&&&&&&%%%&&&&&@&&&&&&&&&&&\n
%#,.//**,*(/(/**,,.//.,,,*###(/((#/,((((##,*%@@@@@@@@@@&@@@@@@@@@@&&&&@@@@@&&%@@@@@@&&&&&&&&&&&&&&&&&&&&%%%&&&&&&&@&&&&&&&&&&&@@&&&&&&&&&&&@%%%&&&&&@@@&&&&&&&&&@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n
((.*/(,..*.*((*,*(,(*,...*#/(#(//,,*/(##(((**/%@@@@@@@@@@@@@@@@@@@@&&%%&@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&%%%%%%%%%%%&&&&&&&&&&&&&&@@@&@&&@@@&&&&%%%&&&&&&@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%&&&&&&&@&&&&\n
/*./**/##*. .*,,/(*/(,*#*,,*,(*****,#%/#(///*.,*(%@@@@&@@@@@@@@&@@@@@&&&@@@@@@&&&&&&&&&&&&&&&&&&%%%%%%%%%%%%%%%%#%&&&&&&&&&&&@@@@@@@@@@&@&&&%%&&&&&&&&@@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n
*/*/,,*(##*.*,,*//*///(#//((*******/#,*/((((((((((/(&@@@@@@@@@@@@@@@@@&&@@@@@@&&&#&&&&&&&&&&&%%%%%%%%%%%%&&&&&%%###%%&%%&&&&@@@@@@@@@@@@@@&&%&&%&&&&&&@@@@@@&&%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@&&&&&\n
*/*((.(*,*(/,,,,**/(////(#%(/****.,(#,#*/**/////((///*%@@@&@@@@@@&@@&@&%@@&&&@&&&%&&@&&&&%%%&%%%&%%%%%%%%%&&&&%%%###%%%%%%%&@@&@@&&@@@@@@@@&@&&&%%&&@&&&&@@@&&&&&&&@@&&&&&&&&&&&&@&&&&&&&&&&&&&&&&&&&&&&\n
/,*/#((/%,**,***//(,*/(////(%%*,**//((/#(///*,,/((((/(/*(@@@&&&&&&&&&&&&&&@@&&&&&&&&&&&&&&&%&%%%%%%%%%##%%%&&&&%%%%%#%%%%%%%%&@@@&&&&&@&&&@@&&&&&%&&&&&&%%&&&&@&&&&&&&&&&&&&&&&@&&&&&&&&&&&&&&&&&&&&&&&&\n
,*/#,*#*.**,***/(#(*(///////**##,,(/**(##(///***((/((((*,*/&@@&&&&&&&&&@@@@@@@&&&&&&&&&&&%%%%&%&&%%%%%###%%&&&&&&%%%%%%%&%%%%%&@@@&&&&&&&@&@@&&&&&%&&&@&%##%%%&&&&&@&&&&&&&&&@@&&&&&&&&&&&&&&&&&&&&&&&&&\n
**/(#(,,**,.,**//*#*////(((((%&%((((((/((((///*,*#/***(((//*/%@&&&&&&%&@@@@@@&&&&&&&&&&&&&&&&&&&&%%%%####%%&&&&&&%%%###%%&&&&&%%%&@@@&&@&&@&@@&&&&%%%&&&%#%%%&@%%%&&@@&&&&&&&&@&@&@&&&&&&&&&&&&&&&&&&&&&\n
*/%%##(/*,,((,(*.,,****((%#/**//**//////((####(##((((//(/*/(((#&&&&&&&&&@@@&&&&&&&&&&&%%&%%%&&&%%%%#%%%#&@&&&&&&%%######%%&&&@&%%%&@&&@&@&&&&@@&%%%&%#%&#%%%%&&&&%%%&&&@@%&&&&&@@&@@@&&&&&%&&&&&&&&&&&&&\n
/(%/.*/*,,//#/**(#/,(%%%#/*/**/(((*##(*/*,(//(((**((*//,,*(##(((&@&&&&&&@&&&&&&&&&&&&&&&&&&&&&%%##%%&&&&&&@&&&%%%########%%&@@&%%#&#%&&&&&%&@&@@&&&&&%#&%#%&@&&&&%%%%%&&@@&&&&&&&@@&&&&&&&&%%&&&&&&&&&&&\n
**,,.,/,,,*//%**###%%(((##/*/*,**/(%#/(//*/(/*((/*/%((##%#//*/(#&@&&&&&&&&&&%%&&&&&&&&&%&&&&&%(###%&&&@@@&@&&&%####%%%%%##%%@&&%%&%&@#%@%%@%#&&@&&&#%&&%#%&&&&&&%%%&%%%&&&&@&%@&&&@&&&&&&&&&%&&&&&&&&&&&\n
/(/..*,,,*/(((//#(,**,/ *//, **/////((///,*/#/,*/*/##%#(**,/##((&&%%&&&%#%&&&&&&&&&&&&&&&&&&%(#%%%&@@@@@@@@&%%###%%%&%%%%#%%%%&&%@@@#%%#@&%%&%&&@@&&&%%%#&%&&&%%%&&%%%%%%&&&@@%&&%&&&&&&&&&&&&&&%%&&&&&&\n
/(*./*.*(((((((/(#/***,.. ,*///*/***,/(////*/#/,,((%#%/*///##(/(#%%%%%%%%&&&&&%%&&&&&&&&&&%#(##%&&&@@@@@@&&%####%%%&&&&&@&&#%%&&@@&%&%%@%%&@&%%&@@&&&&@&%%%%%##%%%&%%%%%%%%&&@@&&&%&&&&@&&&&&&%%%%%%&&&&\n
*****,,*(#/*((***/,**,.,//**,/(*,*,*/*##///*/(//(#(,##*,(%#/,*(%%%&%&&&&&&&&&&&&&&&&&&&&%%((#%%%&&@@@@@@@@&##(%%&&@@@@@&@&&#%&@&@&%@&@@%%&@&&%&&&&&&&&&&%#%%%#%%&%%%%%%%%%%%%&&&&&&&%%&&&&&&&&%%%%%%&&&&\n
/,,*,,*//((/,/(*,  ****,..,(/*(%(/,,***#(,,//***///*//*/#(/**/%%&&%&&&&&&&&%%%%&&&&&&&&&%##%%%%%%%&&&&@@@@%###&&@@@@@@@@@@&#@#%@%%&&@@%&@&&&@&%%&&@@&&&%#(%%#%%%&%%%%%%%%%%%%%%&&&&&&&%%&&&&&&&%%&%%&&&&\n
*/*,*,,**//(//*,*****,...*(//,//%%*,/.*(/,#*///*,*(***/(/**(//#%%%&&&&&&&&&&&%&&&&&&&&@&%%&&%%%%%%%&&&&@@&##%&@@@@@&@&@@@@&@%%@@&&@@&&@@&&@@&&%%&&&@@@&&%&%%%#%%&&%%%%%%%#%%%%#%%&&&&&&%#%&&&&&%%#&&&&&&\n
%#*,,..,(/(/**//,((((/**,*/**/#/.*#/.*,,#**(#**//(//(#/(//,/(##%%%%%%%&%&%%%%%%%%%%%&&&&%#&%#%%#&@%&&@@&&%#%&@@@@@@@&&&@@@@%%@@&&@@&&@&&@@&@&&&%&@&&&&&&%%@#%#(%%%%%%%%&%%#%%##%%&&&&%%%&%#%&&&&&&%%#%%%\n
.*,,.,,/(*(****,,.*///////*(%&%#//,,/(/,((////(*/(/*/#///.*/(#%%&%%%@&&&&&%%%%%%%%%%%&&&%#&%#%##&&%%&&&%##%%@@@@@@@@@@@&@@&%@@&@@@&&@&&@&&&&&@@&&&&&&&@&&&@%%######%%%%%%%#%%###%%%&&%%&%%#(#&&&&%%%%%##\n
**,,....,(///////,./(((/,/(((##(/(/,(/***#(**.,/((/(#((((/*(###%&&&&&%%%&%&%%&%%##%%%&&&%#@&%%##%&%#%&%##%%&@@@@@@@@@@@@@@@@@@&@@&@@&@@&&&&@@&@&&&&@&&&&@&%%&####%&&&&%%##%%%%#((##%%&%%%%%%##&&&%%%%%&&\n
*,.,///*,#* .(*.//.*((**###(#/,,(/./#(/**(/,/*,,*/(//#//#**/#%%###%%&&&&&&&&&&&%%%#%&&@@%#@&%%######%&%%%&&@@@@@@@@@@@@@@@@@@@@@&@@@@&@@@@&&&@&&@@@@&@&&@&%%%%%#%%&&&&%%#%%##%%%%###%%%%%%%##((#%%%%%#%%\n
/*.   ,. ****((/((*.**/###*/(%%(/#(*,/**,,,,*****((/**((#(/((###(%%%%%%&&&&&&&&&&%&&&&@@@(@@&%%##(##%&&&&%&&@@@@@@@@@@@@@@@@@@@@@&@@&@@@@&&&@@&@@@&@&&&&&&%&@%%#(#%%%&&&%########%##((####%%%%%%%%%#####\n
.**((//**/*,,,*//***/(//*/((#&&%####/*#,//***/(%%#/(((((#(#%####%%%%&&%&&%%&&&&&&@@@@@@@@%&@@%%#####%%&%%&&@@@@@@@&@@@@@@@@@@@@@@@&#@@&&&%&@@@&@@&@&&&@@@@&#&&&%#(((#%&%%%%%%%#(#%##(((##%%%%%%%&%%&%##%\n
/  ..., .,***,(##/**,///,/(////*//(#%##*//***,.,,,*//(,*//###((###%%%%%&&%%%###%%##%@@@@@@#@&&&%####%&&&&@&@@@@&@@&@@&@@@@@@@@@@@@%@%&&@@@@@@@@@@@@@@@@@@@&%#@%#((/(%%&&&%%%%%%%#####(((###%%%%%###&&#%%\n
,.*****,,,**,,/,,*/*,**, ,/#/*//(///#/#(#%#(/(//,******#######(/##%#((%%&&&&&####%%%&@@@@@%%@@@&%###%&&&&&@@&@@@@@&&@@@@@@@@&@@@@@&%@@@@@@@@@@@@@@@@@&&&&&&&&&##((##&%%%&%%%%%%%%%####(#####%%%%####%&&&\n
,,,,,..,((#/*,*, ,,,,*///,..,#(.*,///*/((*,/,,**,*/,.*,*(####(((((#%&##%@@@@@@@@@@@@@@@&&@@##&&@@@%#&&&&&&@@@@@@@&%@@@&@@@@@@@@&@@%@@&@@@@@@@@@@@@@@&&&&&&&&&&@%(%&@&(%%&&%%%%%%###%%#((##(#%%%%%%%#%%%%\n
.((,,(****.,,,,*.,*,.,//.,((*#*,,,*/(**((/,**,,**,/(//(#%###(((###%%&&%((###&@@@@@@@@@@@@@@&#(#%&&@&@&&&&&@@@@@@%%@@@@@@@@@@@@&@@@@&@@@@@@@@@@@@@@&@@&&&&&&&&&@%(##@@&#(#%%%%%%%#######/(#####%%%#####%%\n
/.*,*//*(/,,*///*,,./(.,**(,****/(*,*(/****, ,*/****/(#%#######((###%%%%#((#%&&%%&&@@@@@@@@@&%(####%%%&&&&@@@@@@&@@@@%&@@@@@@@@@@@@@@@@@@@@@@@@@@&@@&&&&&&&%&&&&#%%%@&#(###%%%###(((((((#######%%##%#%%%\n
(#(,*,,/(*,.**,*/#,.,..**//**/(##*/*/*,*,**////(((/(%%%##(#%%#####(###%&&&&#%&@&&@@&&@@@@@@@@@&###%%%#%&&@@&@@@%%@@@&@@@@@@@@@&@@@@&&@@@@@@@@@@&@@@@@&&&&%%&%%%%%%&&&%&&%%%%%%%%%%######(((#####%#%%%%%%\n
%*/*,,/(,,,,,*,,,*/%%/*((#//*/,,///(***,,,*, ,*/(#########(((((######((((#&&@@&&&&&%&@@@@@@&@@&&&&@&&&&&&@@@@@@@@@@@&@@@&&@@@@@@@@@&&@@@@@@@@@@@@@&&&&&&&&&&%%&@%#&&%##&@%%%%%%%%%##############(##%%%##\n
(((,,**//,..,/%&%((///*../.,***,,****/*,,,*((#(############(/(###((#####(/(//(#%&&&&&&&@@@@@@@&&&%#%%%%&@@@@@@@@@@&&@@@@@@@@@@@@@&%%&&@@@@@@@@@&&&@@@@@@&&%%%%&&@#&@@%#%&&%%%%%%%%%#####################\n
*/#**,*(,,(%#*(**(#*,/(//((*/(,*,**,/((,,,/####((###((####((/##%%%#####(((#%%%%%%%%&&&&&&&@&&&&&&%%%%%%&@&&@@@@@@@@@@@@@@@@@@@@@&##&&@@@@@@@@@@@@@&&&&&&&&&&%%&&@%#@@&%%&&%%%%####%%####%#####(#(##(####\n
/(**/((%#//%*,**,*/#((///******,,((((((,.,/##((###((((#%#(/,,*(##%&%%%%######%%%%%%%%%&%%&&@&&%%%%%%%%%&&@#&@@@@@@@@@@@@@@@@@@&(#&@@@@@@@@@@@@@@&&&&&&&&&&%##%%&&%##@&%%&%%%%%%##%%%%%%%%##%###(((((####\n
**%%%(,,/,,#,.,(,/#%%%&&&&&&@&(,*%@&&&&*,,#%%%%%%%%(##/,,,,/###((((((##%%%&%%%%%%%%%%%%&&&&%%##%%%%%%%&%%#/#&@@@@@@@@@@@@@@&&#%&&&&&@@@@@@@@@@@@@&&&&&&&&&%&&%&@&%###&%%%###########%%%%%%#(#%###//(((/(\n
,,/#(*,*/(,,.*/#%&&%%%%#%&@@@@&**(@&&@#/,,%&&%%###(/,,,,*(#(####((((//////(#%%%%%###%#(##((#####%##%%####/*/%@@@@@@@@@&@&&&%##%&@@@@@@@@@@@@@@@&&&&&&&&&&%%&##%&&%#%###%##(((##########(#####/(##((((///\n
,#*,///**((/(((#####%%&&&%#(((#,*/&&#*,,,*%*/%&%(,.,,,/((#%%##((((#%&&%&%%%%%%%##%##((###((((((#%%%%#((###%&%%&@@@&&&&&&&%##%%&@@@@@@@@@@@@@@@@@&&&&&&&&&&&%#%%%&%#%%#/####((#####((%%&&%######/(((((#((\n
*,,,****#%(///((##%/#%%%(**////*,#%*.*/*,*,/*/*,.,,*///((((((###%%%%#(((%%%&&&&%%%%%%%%%###((((##%&%((((########%%%%%%%#(#%%%&&@@&@@@@@@@@@@@&&&&%&&&&&&&&&%%%%%%(#%&%####((//((##%/**#%#########/(###%%\n
*,*,,(#((#%%/,(((#((##**((//**/**.,,,*(,,,,,,,,,,**/(##%#(((((##########(/(#%&&&&&&&&&&%&%(((//((##(((((((((####%%%%%#(/#%%%%&&&&&&&&@&@@&&&&&%%%%%%&&&&&%%%%#%((#%#((#####(((((##*,/%%%##(/(((####/#%%%\n
/,..*/**//(/,,(/**/(*,**..,&#*(((.,,*.,,,,,..,,,*//(((/(###(((###%%&&&&&&%#((#%%&&&&#//***,*/(////(/////,*/(%@@@@@@&&%%#(##%%&&&&&&&&&&&&&&&&%%%%%%%%%%%%%&%%%#(*(((/%#######/(/,,(#/(##%##(//(###%%#/#%\n
,/(/*//***,(*/%*****,,**(*/%#,*//.,,*...,...,,,,*////(#%%#((((((#%#%%##%%%#%&&&@@@%#&@@&@&%##(((((((((/*(%&@@&&@@@&&&%%%((##%%&&&&&&&&&&&&&%%%%%%%%&&%%%%%%&%###((##/*#((#/*((,*(#(//(((((((((####%&##%/\n
/*///*//###*/(/,,***/,.,,/*/(*//*,.*..........,****,,/((//////((((#(((##((#&&&&&&(%&@&&@&&&%%##((((#%%&@@@&&&&&&@@@&@&&%#/(##%%%&&%&%%%%%%%#%%%%%%%%%%%%%%%(/%(/(#/*,/#(**/*.*#%#(((*#*///////(#####%%%#\n
**/*///(#(((////***,,#*.,,(*,/*/* **,........,,*,*,.***,,,(%%*(((((###%&&&&%%&%%#&&&&&%%%%%%%%&#%#####%%%%%&&&&&&%&&&%%%%(//(#%%%%%%##%####%%%%%%%%%%%%%%&*,#((//**/.(/,**.*(((((((/** .*//(/((((((((%((\n
*/((/((/*/,**(#(,**///((*//*,*//,,   .**,. ..,,,**,.,,,,**,**////((#%%%%##%%#%##%%%%%%%###((##&&######(###%%%%%%%%%%%%%%%%##############%%%%%#%%%%%%#*/%%/,#%(**//**,,*,.((//(/**,,*,(#/..,,*//////(//**\n
/(,.//*,***/***(#/,*(*//***(,/*/..***/. ,///*,.,.*/...*,.,*,*/((((((###%%%%#####(((###(((/(((###%%###(#%/(#####%%##%%##(((#############%%%%%%#%%%%%%%%#(*,/#/******,,,,,/,***((,  .,*#/***,.  ,,,,,*/((*\n
%(#,**,**,***,,/##,**,#*%%*#//***, ..,. .,,.//,/(##(/,  ,*,,*((//(##((#####/(##(/(((#(#%(((((((%%%%%#%%#/((########%###############(((#####%%##%%%%%%#(/*,,*/*,,,,,,,.,*,..** */**,, .//***,*, ....,,,*,\n
*/%(#/,(*/***.,,,,,/(/,/#,#**//* /* ./,,..,,,,,/(*/((/*#(*,.,****/((((###((((((###(####(/#%#(/((##%%##%#*(##(########(#########%%%%%%##((((#//####%###**,,./*,,**,,,*,*, ,/*,,.*/***.  ,/**/*.,,,,......\n
(*(/(/##((***,*/(#*/*,,,/%((***(#(##/(,...  ,***/*,*((,    .*(#(**///(((###((((((((###((%&%##((///((((#%(*(######&#%%###%%%%%%%#%%%%%%%%%%#(/,/#######*,,(/*,,,,..***((,/,..../%((*.,,,.,,,**/. ...   ..\n
***##,(%#*,*,./***,*((*((./(***,. **%#,**///***/*,///(**,.     ***/(#####((##((((((%#######%##((/**/*/#((/*######%#&%%%%%%%%%%%%((#%%%%%%#/*,*,*######%(,//,,....(, .**,,*../*,,,, ...,.  ./***,,*//*  .\n
,*/*/,,,/#&&(((****/(*/%%*/*,**,*////%%(, .,/*,,,. ,/(**///(/***.**/(#########(((((((((((#&####((///*((/((*(%####%#&##%%%%######/,*####//*,. ,*,,.,(#%####(,...../ ,//,*.,*, .(/,.  ..,/,.,,***,,,. */*,\n
*****//#/.,/#/,//,.,,(*/%((##(*#,..*((/(%#*,*/,,,..,**,,.   .*/,,,*//########(#(((((/////((((####((((///(((,(#(#(%(&#########((#/,,/(/,*#(, .,*,*/(*,*(#%##(#*.../  /,*** ./(,,.,,*/*,. .,.,(.**,,,  ./#\n
,,**,/%((/****###(*****((/(***((#%%(*,/,,/(/,**,,,,,,*,./((((/   ..*/(#########(((((((((///(#######((////(#,*//((&/&######(((////*,**//,.  .,,,*,,..*(**,*#%#((/*/,,,,..,*,  .,,,,...,/((*,,#.,.*,,,,,**\n
#%#(//#(//,. ..,****#%//*./***,(,.***((((((*,(*,,,..,//*,.,,,,,.,,,,*(########(((///(////(((#%%%%/##(////((**//(#&/&#/##//////////,,*. .....,*,**,,*((,,***,/###(/*, .*,.,*,,,,,*****, .,**,*##,*,,,,*,*\n
*,,,##*////*/#%%###***//../***,,,*/((((,((/#%%(##*..,,,,,.(**,,,,,.,/#/(((((((/(((((((((/(#(##((/(((((/////*/*//(&(%(///****//(((/,,*,**********,*,/,.*,.  ..../##((/,  .*//,..,,,**/((/***,(,(,.,*,*,,/\n
#/((,/%#/..******,,,*##(((,*,*,.**(((*##*/#/**,*(%%(/(####*,,,,,,,.(/*,*****////((((///#&%#(/////////*#(,(/****//%((#*,*///((/((,.,,,,,.. .*,,*..,,,,**,,,,..,,,,*((((#(., .,.,*.*,*%,**.//,##.//.,, ,//\n
/* ,/,,%%*(*//,,///*,,*/(/*****.*((*/,/(((/#*,(%*,*,*(###/(##(//,,.*%#((//////(#%%%#(//#****************(%/******(##%/%#/(((**, *, *,,,.,*,,,**..,,,**,....,,.,,,, ,/((/(*..,. ,%/.//..,/, .*#(,.*//#/,/\n
#/,*,/,*(%//#/../**(,,(**/,,,,,,,.*,*/(//(/*#((*.,*/((*/(#//##%#(/,,.(%%%#((/*,,,,,*/(#//****((/**/***,,*/(#(/**((%%((((###*/&%* .*,,,*. .,***,  .,,,,. .,....,,,,,.../(////,,,*/*/(*//,,,*.*(((*.((,*((\n
#.,#((**((%%**/**.*,*#%#/******,,(#(,,,*(*(//(/.*/,*/, ,/,.*/(/,.,,,.,,/#%/.,,,,,//*%%/*****/*. .,*****,*/*,,/#/*//(#/(,*//((##/*.,,,,**,,(***. .,,,,,.,,./*. ..*,,,*(**/(//(*,/,.,,*/***.,////(((.,((*(\n
%%//#%%(/(#&&(/%&#(/..,***,/((,*,*.,,,*//****/(/*(/*(*,/(*,..*,.*//***.../#%#((((/,./***,*******(%#/,. //*/**/(/*//%##%%((##/***(#/,,,,,****/. .,,*,,,,. //(*,*/ .**,// .,((//////*,.*/*///,,,,/(.**/*((\n
(/(//(/*(.,*/&&((((/(#(***/,,,/(.,#((*,*,*,,*,***/((/,,*#*//((*. .,,,/#/. .(#%%#,.*(/,,*(,*%,/##(#//(*//,,/,,,,.,,,(((((,,,/(#((((/**,,,*******,,.**,,,,/(,**/**,***,,,/(. *(////,.,*/*//,, *,/*////(*,*\n
(,,(/##/%&%//((%%(((/(#%#,*,,/,*,.,,*/**,*//,.****,,,,,*#*#((%(/(/.*(*&(#(/,,,*,//((#,,,*,(##(/*,..,////,.*,******,*(#/#(..,,..,*****,,,,,***,.,*,,,,,,,.,,*,,,,*,.,,,*...,,,((/*///.../**////**//**/(**\n
%%##%%(/(#((*(%((%#//(#(//**,*/**,,,,*.,,/*,,*,,**/((,*##/#/(%#%(/(.,#%((((*.,(/*//((/,,,,***********/////((/((((#*./((,/#*,,,,,#,,**,,,,((/,,,,,,.,,,,,/. ,*,,.. ,*,,,,***/,,,#(*** .//,/,,//,(/,(*.,//\n
*/(%%(.,#,(&#%%(*/#%#//***,//.**,,,,,**.,%/*,,,,/(/**((#(,*((//..*..,%/////((((##/*,*/*,,,(*,(#..((((/********,..*,*(##%%%%(//(((/*/*,,,,*,,.**,*,,,.,,,,,,,.,*,.**,,,*,,,,/*,,/#/***,/(..*//,//.,*(*.**\n
/,/#((#(&%(%(,/%(((*##/*****(*,*,,.,,,,*/%##,,******(*/(#(*,,..///(/*,/(/(((*,,*,*((*,,,,,,./.#/.**/,,,(/***(#(//*/((///,(///,,,*,****,,,*(,,,,,,,,,,**,,**,, *,,.,(/,,,*(.,**,,*.****//,*/*,(/(/.,(/ ,/\n
*(/#(##*(&(/#%&&%%#//%/*(((#((,,*/,,,,,*##/...,/.,/*,.*(/*,*,./*./(//*.((((/../(((****,,**,,*,*%&/**,.  ,,****,*(%#*,..**((/###(/(/((/*,,,/,*//*,,,,...,,.,,..,.**,,.*,,  ,/##(**#,/*,/(./, /****.,//*.(\n
*,,,##/#****,,,*%#/#(/#*#*/**(/,,/.,,.*(/*,,,*/(#/(#(,//,./(,,,/(#(.*#,/##%,.,/(((*,,,,,*/*#(/,(*.,/,(,.,,..(/*/*/*#%/**,,,##///*. //**,,,,,/*...,,...,,,,  .,*,,,,,.,,,,.,**,,,*#*./*,.***(*,,*(/******\n
,,,,,,,(((&//#*#/#/,,(%/*(%*/(*,,,,/*,(//,,,,,,,*..,,..**(*//*.,*/,,*//.,/*.,,,,,*//,,,,*,,,,*,,// ,%#* .,/**##((((,*(%*%#,,.,,*((*,/((/..,** ,, ......,,,,,,,**.,*/,/((*,//,,*,,*%,./,.*,/(/,*, *,..,//\n
,*/*,,,,,*(%#(%#/(%**###*,(%*#(/*,,*((***.,**,,/(,,,***..*//*,..,,,.,,*,,/* ,, ,,,/*,.,, ,,,, ,,,,*#&@,.(*,**(/./*(%/*(&#(%(*,,.*/*/,*/*,.,./,,. .**/*.,,,*,,,,/*,,%. ,,.*/*.*/,*,,,.,*.,,,,.*(##%@&#/*,\n
.*#.(#,,,,,,/(((#((%%/(%**%&#/**,,,,../#&@&*,,*,,,,**./*,,,**,,,..,,,,***,,*,,..,,,,,,.,,..,,.****&#/,,*, ,, (/ ,((/**,*/,,%%///****..*/*,...../**(((,*/,,,,,.,#**.##*.,*/*.*/*,,,.. *,.*,**(#*,.,..,/(,\n


View File

@ -0,0 +1,28 @@
\033[0;5;33;40m8\033[0;5;30;40m8\033[0;5;33;40m@8t X\033[0;5;37;40m8\033[0;1;30;47m8\033[0;5;33;40m :\033[0;5;37;40m88\033[0;5;33;40m:\033[0;1;30;47mX\033[0;5;33;40m%.\033[0;5;37;40m88\033[0;5;33;40mt.\033[0;1;30;47m%\033[0;5;37;40m8\033[0;1;30;47mS\033[0;5;33;40m%;.\033[0;5;37;40m8\033[0;5;33;40m.. \033[0;5;37;40m8\033[0;5;33;40mX\033[0;1;30;47m@\033[0;5;30;40m8\033[0;1;30;47mS\033[0;5;33;40m.\033[0;1;37;47mXS\033[0;5;37;47m888\033[0;1;37;47m%\033[0;5;37;47m8\033[0;1;37;47mX@\033[0m
\033[0;5;33;40m@S;\033[0;5;32;40mX\033[0;5;33;40mS\033[0;5;37;40m88\033[0;1;30;47mS\033[0;5;33;40mX.\033[0;1;30;47m8\033[0;5;33;40mX\033[0;1;30;47mX\033[0;1;30;43m8\033[0;5;33;40m.\033[0;5;37;40m8\033[0;5;33;40mt%t\033[0;5;37;40m8\033[0;5;33;40mt :8 .\033[0;1;30;47mX\033[0;5;33;40mt:\033[0;1;30;47m %\033[0;5;33;40mS \033[0;1;30;47mt\033[0;5;33;40m:\033[0;5;37;40m8\033[0;5;33;40m.\033[0;1;30;47m;\033[0;1;37;47mS8SS\033[0;5;37;47m88\033[0;1;37;47m%\033[0;5;37;47m888\033[0m
\033[0;5;33;40m.t;.\033[0;5;37;40m8\033[0;5;33;40m% \033[0;1;30;47m:\033[0;5;33;40m;\033[0;1;30;47mS\033[0;5;33;40m%\033[0;5;37;40m8\033[0;5;33;40mX:tt @;;.\033[0;5;37;40m8\033[0;5;33;40m:\033[0;1;30;47mS\033[0;5;33;40m%\033[0;1;30;47m;X\033[0;5;33;40mS\033[0;1;30;47mX\033[0;5;33;40m;\033[0;5;37;40m88\033[0;1;30;47mX\033[0;5;33;40m:\033[0;1;37;47mtS8@8\033[0;5;37;47m8@8888888\033[0m
\033[0;1;30;47m:\033[0;5;33;40mt: ttt\033[0;1;30;42m8\033[0;5;33;40m8:\033[0;1;30;47mt\033[0;1;37;47mSt\033[0;1;30;47m \033[0;5;33;40mt :%\033[0;1;30;47m@\033[0;5;33;40m;8%\033[0;1;37;47m;\033[0;1;30;47m;\033[0;1;37;47m:XX\033[0;1;30;47m@\033[0;1;37;47m:8\033[0;1;30;47m \033[0;5;37;47mS;\033[0;1;37;47m8\033[0;5;37;47mX\033[0;1;37;47m8\033[0;5;37;47m@8\033[0;5;1;33;47m8\033[0;5;37;47m8\033[0;1;37;47mt\033[0;5;1;33;47m8\033[0;5;37;47m8%S@\033[0m
\033[0;5;33;40m \033[0;1;30;47m \033[0;5;33;40m:;%X\033[0;5;37;40m888\033[0;1;30;47m;\033[0;1;37;47m8\033[0;5;37;47m ;;..;\033[0;1;37;47m8t\033[0;1;30;47m \033[0;1;37;47m:8\033[0;5;37;47m88888@XXSXX\033[0;1;37;47m8\033[0;5;37;47m@t8@\033[0;5;1;33;47m8\033[0;5;37;47m888888@\033[0;5;1;33;47m@\033[0;5;37;47m8\033[0m
\033[0;5;33;40m.%;t\033[0;5;37;40m8\033[0;5;33;40mS\033[0;1;30;47m8\033[0;5;33;40m%t\033[0;1;30;47m;\033[0;1;30;43m8\033[0;1;37;47mt\033[0;5;37;47mS:tt8%S\033[0;1;37;47m8\033[0;5;37;47m@88\033[0;1;37;47m%\033[0;1;33;47mS\033[0;1;37;47mt\033[0;1;33;47m%\033[0;5;37;47m888XSS\033[0;1;37;47m88\033[0;5;37;47m8t8888\033[0;5;1;33;47m8\033[0;5;37;47m888888\033[0m
\033[0;5;37;40m8\033[0;5;33;40m t%\033[0;1;30;47mS\033[0;5;33;40m.\033[0;1;30;47m \033[0;5;33;40mt \033[0;1;30;47m.\033[0;5;33;40mX \033[0;1;30;47m \033[0;5;37;47m%@8%@88\033[0;1;37;47mSX\033[0;1;33;47m%\033[0;1;37;47m \033[0;5;37;47m88\033[0;1;33;47mX\033[0;1;37;47m.\033[0;5;37;47m88@X%\033[0;1;37;47m@\033[0;5;37;47m8\033[0;5;37;43m8\033[0;5;37;47m8888888\033[0;5;1;33;47m8\033[0;5;37;47m888\033[0m
\033[0;1;30;47mSt\033[0;5;33;40mX:@\033[0;1;30;47mS\033[0;33;47m8\033[0;1;30;47m:\033[0;33;47m@\033[0;1;30;47mS.\033[0;33;47m@\033[0;1;30;47mX\033[0;1;30;43m8\033[0;1;30;47m8\033[0;5;37;47mX8%88\033[0;1;37;47mt\033[0;5;37;47m88\033[0;1;37;47m.\033[0;5;37;43m8\033[0;5;37;47m88\033[0;1;37;47m \033[0;1;33;47mS\033[0;5;37;47m8\033[0;1;37;47m:\033[0;5;37;47mXS8X\033[0;1;37;47m.\033[0;5;37;47m8\033[0;1;37;47m \033[0;5;37;47m8\033[0;5;1;33;47m8\033[0;5;37;47m888888\033[0;5;1;33;47m8\033[0;5;37;47m8\033[0m
\033[0;5;33;40m:8 \033[0;1;30;47m:S\033[0;1;30;43m8\033[0;5;33;40m::\033[0;1;30;47mt\033[0;1;30;43m8\033[0;1;30;47m@\033[0;5;33;40m:\033[0;1;30;47m \033[0;5;33;40m \033[0;1;30;47mX\033[0;1;37;47mS\033[0;5;37;47m8\033[0;1;37;47mS\033[0;5;37;47m88\033[0;1;37;47m;\033[0;5;1;33;47m8\033[0;1;33;47mS\033[0;5;37;47m888\033[0;1;37;47m \033[0;5;37;47m8888\033[0;1;37;47m%\033[0;5;37;47mX8\033[0;1;37;47m \033[0;5;37;47m88\033[0;1;37;47m \033[0;5;37;47m8\033[0;5;1;33;47m@\033[0;5;37;47m88\033[0;5;1;33;47m8\033[0;5;37;47m888\033[0m
\033[0;5;33;40m;@\033[0;1;30;47mt\033[0;1;30;43m8\033[0;5;33;40mX\033[0;5;31;40m8\033[0;5;33;40m \033[0;1;30;47m;\033[0;5;33;40m8\033[0;5;37;40m8\033[0;5;33;40m:.\033[0;33;47mX\033[0;1;30;47mX\033[0;1;30;43m8\033[0;5;37;47m8\033[0;1;37;47mS\033[0;5;37;47m8\033[0;1;37;47mt\033[0;5;37;47m88\033[0;1;37;47m \033[0;5;37;47m8888888888888\033[0;1;37;47m.\033[0;5;37;43m8\033[0;5;37;47m8\033[0;1;37;47m \033[0;5;37;47m8\033[0;1;37;47m \033[0;5;1;33;47m@\033[0;5;37;47m8\033[0;5;1;35;47m8\033[0;5;37;43m8\033[0;5;37;47m88\033[0m
\033[0;5;33;40m;% % \033[0;1;30;47mX\033[0;5;33;40m; \033[0;1;30;47mS\033[0;5;33;40m:\033[0;1;30;47m%8\033[0;5;33;40m.\033[0;1;30;47m8\033[0;33;47m8\033[0;1;37;47mt\033[0;5;37;47m88\033[0;1;33;47m%\033[0;5;37;47m88\033[0;1;37;47m \033[0;5;37;43m8\033[0;5;37;47m88\033[0;1;33;47mS\033[0;5;37;47m@X888@@X888\033[0;1;35;47mS\033[0;1;37;47m \033[0;5;1;33;47m8\033[0;1;35;47mX\033[0;5;37;43m8\033[0;5;1;35;47m8\033[0;5;1;33;47m8\033[0;1;31;47mS\033[0;5;37;47m8\033[0;1;37;47m \033[0m
\033[0;5;33;40m88:\033[0;1;30;47m@\033[0;5;33;40m@ \033[0;1;30;47m \033[0;33;47m@\033[0;5;33;40m:\033[0;33;47m8\033[0;5;33;40m8\033[0;5;37;40m8\033[0;33;47m@\033[0;5;33;40m;\033[0;1;30;47mS\033[0;1;37;47m;\033[0;5;37;47m888\033[0;1;33;47m@\033[0;5;37;47m88\033[0;1;35;47mS\033[0;1;33;47mS\033[0;5;37;47m88S:tXtt%@8888\033[0;1;37;47m \033[0;5;37;47m8\033[0;1;37;47m \033[0;1;31;47mX\033[0;5;37;47m8\033[0;1;37;47m \033[0;5;37;47m8\033[0;1;37;47m \033[0m
\033[0;5;33;40m8\033[0;5;32;40m@\033[0;5;33;40mX:;.\033[0;1;30;47m;;\033[0;33;47m8\033[0;1;30;47m8\033[0;5;33;40m: .\033[0;33;47m@\033[0;1;37;47m \033[0;1;33;47mX\033[0;1;37;47m \033[0;5;37;47m8\033[0;1;33;47m%\033[0;5;37;47m8888\033[0;1;31;47mX\033[0;5;37;47m88S%;: 8%%S@X8\033[0;5;37;41m8\033[0;1;37;47m.\033[0;5;37;47m8\033[0;1;37;47m \033[0;1;33;47m%\033[0;1;31;47m@\033[0;1;37;47m \033[0;5;1;33;47m8\033[0;1;37;47m \033[0m
\033[0;5;33;40mS; %S:SS.\033[0;1;30;47m8\033[0;1;30;43m8\033[0;5;37;40mX\033[0;1;30;43m8\033[0;1;37;47m \033[0;1;33;47mX\033[0;1;31;47m@\033[0;5;37;47m8\033[0;1;33;47mS\033[0;5;37;47m88X%\033[0;1;37;47m \033[0;5;37;47m888@St:.;.;tS88\033[0;1;37;47m:\033[0;5;37;47m8\033[0;1;33;47mS\033[0;5;37;47m8\033[0;1;31;47mS\033[0;1;33;47m%\033[0;1;31;47mS\033[0;1;37;47m \033[0;1;33;47m%\033[0;1;37;47m \033[0m
\033[0;5;33;40m 8\033[0;5;31;40mS\033[0;5;33;40m \033[0;1;30;47m@\033[0;5;33;40m \033[0;1;30;43m8\033[0;5;33;40m%\033[0;5;31;40m8\033[0;1;30;47m8\033[0;1;37;47m;\033[0;1;33;47mX\033[0;1;35;47m@\033[0;1;33;47m@\033[0;1;31;47m@\033[0;1;37;47m \033[0;5;37;47m888t8888@t::;t.;;@8\033[0;1;37;47m;\033[0;5;37;47m8\033[0;1;37;47m \033[0;5;37;47m8\033[0;1;37;47m \033[0;5;37;47m8\033[0;1;33;47m%\033[0;1;31;47mS\033[0;1;37;47m \033[0;1;33;47m%\033[0;1;37;47m \033[0m
\033[0;5;37;40m8\033[0;5;33;40m.\033[0;5;37;40m8\033[0;5;33;40m \033[0;1;30;47mt\033[0;5;37;40m88\033[0;5;33;40mS\033[0;1;30;47mt\033[0;5;33;40mX\033[0;1;30;47m.\033[0;1;37;47m \033[0;33;47mX\033[0;1;30;47m8\033[0;1;31;43m8\033[0;1;37;47mt \033[0;1;35;47mS\033[0;1;33;47m%\033[0;5;37;47m8888\033[0;5;37;43m8\033[0;5;37;47m88%;.;88..SS8\033[0;1;37;47m;\033[0;5;37;47m888\033[0;1;33;47mX\033[0;1;35;47mS\033[0;1;37;47m \033[0;1;33;47m%\033[0;1;31;47mS\033[0;1;33;47mS\033[0;1;37;47m \033[0m\n
\033[0;5;33;40m t\033[0;5;37;40m8\033[0;1;30;47mt\033[0;1;37;47m;8X\033[0;5;33;40mS\033[0;5;37;47m8\033[0;5;33;40m8\033[0;1;37;47m \033[0;1;30;47mX\033[0;1;30;43m8\033[0;1;30;47m8\033[0;1;37;47m \033[0;1;30;47m8\033[0;1;33;47mX\033[0;1;37;47m \033[0;1;31;47mS\033[0;5;37;47m8\033[0;5;1;35;41m8\033[0;1;33;47m%\033[0;5;37;47m8%888%.:@88\033[0;1;37;47m:\033[0;5;37;47m8\033[0;1;33;47mS\033[0;1;31;47m@\033[0;1;35;47mS\033[0;5;37;43m8\033[0;1;37;47m \033[0;1;33;47mX\033[0;5;37;41m8\033[0;1;30;47m8\033[0m\n
\033[0;5;33;40m8\033[0;5;37;40m8\033[0;33;47mS\033[0;1;30;43m8\033[0;1;30;47mX\033[0;1;30;43m8\033[0;1;30;47m@\033[0;5;37;40m8\033[0;5;33;40m8\033[0;5;35;40m%\033[0;1;30;41m8\033[0;5;31;40m@\033[0;1;30;47m8\033[0;1;37;47m \033[0;1;30;47m8\033[0;1;37;47m \033[0;35;47mS\033[0;33;47m@\033[0;5;37;47m888\033[0;5;37;41m8\033[0;1;31;47m@\033[0;1;37;47m \033[0;33;47mX\033[0;5;35;41m;\033[0;1;37;47m8;\033[0;35;47m8\033[0;1;37;47m \033[0;5;37;47m8S%@\033[0;1;37;47mS@X:\033[0;35;47m@\033[0;1;30;47m8\033[0;1;37;47m \033[0;1;33;47m8\033[0;1;31;45m8\033[0;1;33;47mS\033[0;1;31;47mSS\033[0;1;37;47m .\033[0m\n
\033[0;5;33;40m :\033[0;1;30;47mt\033[0;5;33;40m:tX\033[0;5;37;40m8\033[0;5;33;40m%\033[0;5;30;40m@\033[0;32;40m@\033[0;5;30;40m8\033[0;5;33;40mt\033[0;5;35;40m \033[0;1;30;47m88\033[0;1;37;47m \033[0;5;37;47m888\033[0;1;37;47m: \033[0;33;47m8\033[0;1;37;47m \033[0;5;37;47m%;S\033[0;1;37;47m; \033[0;5;37;47m88\033[0;1;37;47m@%SS%\033[0;1;30;47m@\033[0;33;47m@8\033[0;35;47m8\033[0;1;30;43m8\033[0;1;37;47m \033[0;1;30;43m8\033[0;1;30;47m8\033[0;33;47m@\033[0;1;37;47m \033[0;1;33;47mS\033[0m\n
\033[0;5;37;40m8\033[0;5;33;40mt%\033[0;1;30;47m8\033[0;5;33;40mt\033[0;5;37;40m@\033[0;5;33;40m%t\033[0;5;30;40m@\033[0;5;31;40mS\033[0;5;32;40mS\033[0;5;35;40m%\033[0;5;33;40mS\033[0;5;31;40m8\033[0;5;33;40m:\033[0;33;47m@\033[0;1;37;47m \033[0;1;33;47mS\033[0;1;31;47m@\033[0;1;37;47m \033[0;33;47m8\033[0;1;37;47m \033[0;35;47mS\033[0;1;37;47m:t.\033[0;1;30;47m%;:\033[0;1;37;47m :%.\033[0;5;37;40m%\033[0;1;30;47m8\033[0;5;33;40mX\033[0;1;30;41m8\033[0;5;33;40m8 \033[0;5;31;40m8\033[0;5;37;40mX\033[0;1;30;43m8\033[0;5;31;40mX\033[0;5;33;40mX\033[0;5;35;40m.\033[0m\n
\033[0;5;37;40m8\033[0;1;30;47mt\033[0;5;33;40m;%;\033[0;1;30;47m8\033[0;5;33;40m:t\033[0;1;30;47m@\033[0;5;33;40m@\033[0;5;30;40mX\033[0;5;33;40m \033[0;1;30;47m8\033[0;5;33;40mS%\033[0;5;35;40mt\033[0;33;47mX\033[0;1;37;47m \033[0;1;31;47m@\033[0;1;37;47m \033[0;1;31;47m@\033[0;1;30;47m8@8\033[0;1;37;47m %.% .:\033[0;5;35;40m:\033[0;1;30;47m8\033[0;1;37;47m.\033[0;5;33;40m.8\033[0;5;31;40m@\033[0;5;33;40m%@\033[0;5;31;40mX\033[0;5;33;40m8\033[0;1;30;41m8\033[0;5;33;40mXS\033[0;5;31;40m@\033[0;31;40m8\033[0m\n
\033[0;5;33;40m: \033[0;1;30;47m:\033[0;5;33;40m;%\033[0;1;37;47m;\033[0;33;47mX\033[0;5;37;40m8\033[0;5;33;40mS\033[0;1;30;47m@\033[0;5;35;40m \033[0;5;30;40m8\033[0;5;33;40mS\033[0;31;40m@\033[0;5;33;40m:8\033[0;1;30;47m8\033[0;1;37;47m \033[0;1;31;47m8\033[0;33;47m8\033[0;1;30;47m8\033[0;1;37;47m \033[0;1;30;47m888X\033[0;1;37;47mt. \033[0;1;30;47m8\033[0;5;35;40m.\033[0;5;37;40mS\033[0;30;41m8\033[0;5;33;40m.\033[0;5;37;40m8\033[0;1;37;47m8\033[0;5;33;40mt8%\033[0;5;30;40m@\033[0;5;33;40m.8\033[0;5;30;40m@\033[0;1;30;40m8\033[0;5;33;40m.\033[0;5;30;40mX\033[0;5;33;40m8\033[0m\n
\033[0;5;37;40m8\033[0;1;30;47mt\033[0;1;30;43m8\033[0;5;37;40mX\033[0;5;33;40m:\033[0;1;30;47m8\033[0;1;30;43m8\033[0;5;33;40m:\033[0;1;30;47m8\033[0;5;37;40m8\033[0;1;30;47m8\033[0;5;33;40m tt%\033[0;30;41m8\033[0;1;30;47m8\033[0;33;47m@\033[0;1;30;47m88\033[0;33;47m8\033[0;35;47m@\033[0;1;33;47mS\033[0;35;47mS\033[0;33;47m8\033[0;5;35;40m:\033[0;1;30;47m8\033[0;1;37;47m.\033[0;1;30;47m8\033[0;5;35;40m \033[0;1;30;47m8\033[0;5;33;40mt\033[0;5;31;40m8\033[0;5;32;40m@\033[0;5;33;40mS@\033[0;5;32;40mS\033[0;5;33;40m%\033[0;5;37;40m8\033[0;5;33;40m%\033[0;5;32;40m@\033[0;5;30;40m@X\033[0;5;33;40m@t.88\033[0m\n
\033[0;5;33;40m:\033[0;5;37;40m8\033[0;1;30;47m8\033[0;5;33;40mSX\033[0;1;30;47m@\033[0;5;33;40mSX \033[0;1;30;47m8\033[0;5;37;40m8\033[0;5;33;40mt.\033[0;1;30;47m8S\033[0;5;33;40m;:\033[0;1;30;47m8\033[0;37;43m8\033[0;1;30;47m8\033[0;33;47m8\033[0;5;33;40m:;%\033[0;5;35;40mS\033[0;1;30;47m8\033[0;5;33;40m;\033[0;1;37;47m \033[0;1;30;47m8@\033[0;5;33;40m;@\033[0;1;30;40m8\033[0;5;33;40m:\033[0;1;30;40m8\033[0;5;33;40m8\033[0;32;40mX\033[0;5;33;40m8\033[0;1;30;40m8\033[0;5;33;40m:\033[0;5;37;40m8\033[0;5;32;40mS\033[0;5;33;40m@.8\033[0;1;30;47m@\033[0;5;33;40mX \033[0m\n
\033[0;1;30;47m%S8%\033[0;5;37;40mX\033[0;5;33;40m%:t%tt\033[0;1;30;47m8\033[0;5;33;40mt 8%X%\033[0;1;30;47m@\033[0;5;33;40m::X\033[0;5;35;40mt\033[0;33;47mX\033[0;5;33;40m@:t\033[0;1;30;47m8888\033[0;5;33;40mX;S\033[0;32;40m8\033[0;5;33;40mX\033[0;5;31;40mS\033[0;5;33;40mt\033[0;5;32;40mX\033[0;5;33;40m:8\033[0;5;37;40m8\033[0;5;33;40mSt:@;\033[0;1;30;47m.\033[0m\n
\033[0;1;30;47mXS8\033[0;1;37;47m \033[0;1;30;47m%X\033[0;1;30;43m8\033[0;5;33;40m%%SXS \033[0;1;30;47m8%\033[0;5;33;40m%\033[0;5;37;40mSX\033[0;1;30;43m8\033[0;1;30;47m8\033[0;1;30;43m8\033[0;5;37;40mt\033[0;33;47m8\033[0;5;35;40m;\033[0;5;37;40m%\033[0;5;33;40m % \033[0;1;30;47mt\033[0;31;43m8\033[0;5;33;40m :S%X\033[0;5;32;40mXX\033[0;5;33;40m88\033[0;5;32;40mX\033[0;5;31;40mS\033[0;5;33;40m8\033[0;5;37;40mX\033[0;5;33;40m@S:.\033[0;1;30;43m8\033[0m\n
\033[0;5;33;40m \033[0;1;30;47mt%X\033[0;33;47m@\033[0;1;30;47m8@\033[0;1;30;43m8\033[0;5;33;40m8 %;;\033[0;1;30;47mX\033[0;5;33;40m8.;\033[0;1;37;47m.\033[0;5;33;40m@.X@\033[0;5;37;40mS\033[0;5;33;40mtt;\033[0;1;30;47m88\033[0;5;33;40m@\033[0;1;30;47m8\033[0;5;33;40mt 8%\033[0;5;32;40mX\033[0;30;41m8\033[0;5;32;40mS\033[0;1;30;40m8\033[0;5;33;40m8\033[0;5;30;40mX\033[0;5;32;40m8\033[0;5;33;40mSt;t;;;\033[0m\n
\033[0;5;33;40m:X\033[0;5;37;40mX\033[0;1;30;47m8\033[0;33;47m8\033[0;1;30;47m8\033[0;33;47m@\033[0;5;33;40m%S\033[0;5;37;40m8\033[0;5;33;40m@%88X@@8\033[0;5;31;40mX\033[0;5;33;40m8\033[0;5;31;40mX\033[0;5;33;40m8\033[0;5;31;40mX\033[0;1;30;47m8\033[0;5;33;40m:8 \033[0;1;30;47m88\033[0;5;37;40m8\033[0;5;33;40m%t%\033[0;5;32;40mX\033[0;5;31;40m@\033[0;5;33;40mtX\033[0;5;30;40m8\033[0;5;33;40mt%%8S8X\033[0;1;30;47m8\033[0;5;33;40m%\033[0;1;30;47mX\033[0m\n

View File

@ -0,0 +1,7 @@
/\_____/\
/ o o \
( == ^ == )
) (
/ \
/ / | | \ \
/__|__|___|__|__\

View File

@ -0,0 +1,416 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h> //for void hidecursor(), only required on windows
//challenges:
//make this work on any posix machine (use them defines or whatever)
//populate, addrobot, and addkitten could all be put into one function
//add resize and kitten crushing support
//compact printf statemnets
//read texts and kitscene from file
//"kitten printers"
int in = 0;
int objects = 30; //0-29 are objects, 30 is kitten, 31 is robot
int x[31]; int y[31]; //int x[(objects + 2)]; int y[(objects + 2)]; the + 2 makes room for kitten and robot, but these should be excluded from for loops
char object_symbol[31]; //char object_symbol[(objects + 2)];
int object_color[31]; //int object_color[(objects + 2)];
int object_brightness[31]; //int object_brightness[(objects + 2)];
int object_text[29]; //int object_text[(objects + 2)]; //kitten doesnt have text because a cutscene plays and robot doesnt have text cause you cant colide with it
int populate_stop = 1; int addrobot_stop = 1; int addkitten_stop = 1; int move_stop = 1; int text_stop = 1; //stop variables
int texts = 64; char text[64][128] = { //the text for colliding with nkos, might want to minimize this because it will get big
{"Not kitten."},
{"Not a kitten."},
{"A pigeon with a TCP/IP packet taped to it's leg."}, //i like this line too much not to use it
{"Deez."},
{"The Internet, lying in a puddle on the floor"},
{"Your mother's house."},
{"What is it? I don't know."},
{"That one thing. You know what thing I mean."},
{"A magazine full of bullets... it's not the right type of magazine, though."},
{"Someone spilled their drink here!"},
{"Your Advanced Placement Computer Science Principles classroom."},
{"text 11"},
{"This brick wall is missing a brick! Oh, nevermind, it's just been replaced with a Nokia 3310."},
{"A kitten."},
{"A penguin using an operating system you've never seen before."},
{"An open window shining on a computer with an entirely blue screen."}, //objectively bad //16
{"This white apple is hooked up to a mouse, keyboard and monitor... it isn't doing anything."},
{"A pufferfish using an operating system you've never seen before... the pufferfish is puffed up."},
{"A copy of 'The C Programming Language'."},
{"George (the cat)."},
{"An analog clock running on UNIX time."},
{"The table that you always hit your knee on."},
{"A calendar with some classic cars on it for 2022."},
{"Justice, finally!"},
{"A newspaper dated December 6th, 1941... it seems like it was a good day."},
{"Poland."},
{"An old map of Europe... it looks more like pasta than borders."},
{"The RWin key."},
{"It appears to be a... oh, nevermind."},
{"Another robot! Oh, it's just a mirror."},
{"'Kitten's over there', it says."},
{"A large trashcan, filled to the brim with metal chips... you can't move it."}, //32
{"The 32-bit integer limit."},
{"A generic car, endlessly doing donuts."},
{"A bug, causing problems as usual."},
{"#ff00ff"},
{"3 pythons, squirming in place."},
{"A sign says 'Members Only'... you can't tell what the object is."}, //"You must be a member to discover this object."
{"A segme ntation fault."},
{"The goods."},
{"A partridge in a pear tree."},
{"A penguin wearing a tux."},
{"'Mostly sunny'? What, in this void?"},
{"\\033[1;1H"},
{"The metric system."},
{"h."},
{"'Kilroy was here', says Kilroy."},
{"The stack, don't touch it though!"}, //48
{"A TOR node."},
{":)"},
{"The blue cable drive."},
{"You Win! Oh, wait a minute... nevermind."},
{"An external numpad... two keys are worn down."},
{"An X server."},
{"All of your deleted files, in a pile on the ground."},
{"Dexterity."},
{"A bottle of battery acid, essentially poison for robot."},
{"Sweet, some sugar!"},
{"A block of code."},
{"The third dimension."},
{"CDs stacked so high that you can't see the top... they all say something about '500 free hours'."},
{"A computer with glasses and a fake nose... it might be spyware."},
{"This toaster has a few forks sticking out of the top... the toaster is unplugged."},
{"A label firmly stuck to the ground says 'PROPERTY OF THE STATE'."} //64
}; //elegant, i know
char kitscenetext[7][19] = {
{" \03333/\\_____/\\ "},
{" / \03332o o\03333 \\ "},
{" ( \03300== \03333^ \03300== \03333) "},
{" ) ( "},
{" / \\ "},
{" / / | | \\ \\ "},
{"/__|__|___|__|__\\\03300"},
};
/*char kitscenetext[7][19] = {
{" /\\_____/\\ "},
{" / o o \\ "},
{" ( == ^ == ) "},
{" ) ( "},
{" / \\ "},
{" / / | | \\ \\ "},
{"/__|__|___|__|__\\"},
};*/
char kitscenerobot[7][19] = {
{" ___ "},
{" |___| "},
{" | | "},
{" \\---|---\\ "},
{" | | "},
{" | "},
{" O--O--O "},
};
time_t t;
void hidecursor() {
HANDLE consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO info;
info.dwSize = 100;
info.bVisible = FALSE;
SetConsoleCursorInfo(consoleHandle, &info);
}
void populate() {
for(int i = 0; i < objects; i++) { //initial position randomization
x[i] = (rand() % 128);
y[i] = (rand() % 64);
object_symbol[i] = ((rand() % 93) + 32); //ansi 33-126
if (rand() % 2) { //picks between the top or bottom 8 colors
object_color[i] = ((rand() % 8) + 31); //color 31-38, 30 is excluded because the background is black and the character would be invisible
} else {
object_color[i] = ((rand() % 8) + 90); //color 90-98
}
object_text[i] = ((rand() % texts)); //text 0-127
}
while(populate_stop) { //check if multiple positions are the same, if so then re-randomize those positions
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if((x[i] == x[j]) && (y[i] == y[j])) {
x[i] = (rand() % 128);
y[i] = (rand() % 64);
} else {
populate_stop = 0;
}
}
}
}
while(text_stop) {
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if(object_text[i] == object_text[j]) {
object_text[i] = ((rand() % texts));
} else {
text_stop = 0;
}
}
}
}
object_text[30] = 0; //kitten always gets 2 for some reason so im making it 0 manually for niceness
for (int i = 0; i < objects; i++) {
printf("\033[%d;%dH\033[%dm%c\033[0m",(y[i] + 3),(x[i] + 1),object_color[i],object_symbol[i]);
}
}
void addkitten() {
x[30] = (rand() % 128);
y[30] = (rand() % 64);
object_symbol[30] = ((rand() % 93) + 32); //ansi 33-126
if (rand() % 2) { //picks between the top or bottom 8 colors
object_color[30] = ((rand() % 8) + 31); //color 31-38, 30 is excluded because the background is black and the character would be invisible
} else {
object_color[30] = ((rand() % 8) + 90); //color 90-98
}
while(addkitten_stop) { //check if multiple positions are the same, if so then re-randomize those positions
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if((x[30] == x[j]) && (y[30] == y[j])) {
x[30] = (rand() % 128);
y[30] = (rand() % 64);
} else {
addkitten_stop = 0;
}
}
}
}
//the kitten printer
printf("\033[%d;%dH\033[%dm\033[107m%c\033[0m",(y[30] + 3),(x[30] + 1),object_color[30],object_symbol[30]); //debug the \033[107m gives kitten a white background for easier identification
//printf("\033[%d;%dH\033[%dm%c\033[0m",(y[30] + 3),(x[30] + 1),object_color[30],object_symbol[30]);
}
void addrobot() {
x[31] = (rand() % 128);
y[31] = (rand() % 64);
object_symbol[31] = 35; //robot is always a bright white #
object_color[31] = 97;
while(addrobot_stop) {
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if((x[31] == x[j]) && (y[31] == y[j])) {
x[31] = (rand() % 128);
y[31] = (rand() % 64);
} else {
addrobot_stop = 0;
}
}
}
}
printf("\033[%d;%dH\033[%dm%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
}
void initialize() {
printf("\033[?25l"); //hides cursor on linux
hidecursor(); //hides cursor on windows
srand(time(t));
system("mode con: cols=128 lines=66");
printf("\033]0;rfk\x1b\x5c"); //set conlse title to rfk
//47, 55, 43, 49 i think
printf("\033[8;40HYou are Robot, and your goal is to find Kitten.\033[9;36HThis is complicated by the exsistance of other objects.\033[10;42HYou must touch an object to see what it is.\033[12;39HUse the arrow keys and press any key to continue.");
getch();
system("cls");
printf("\033[2;1H--------------------------------------------------------------------------------------------------------------------------------");
populate();
addkitten();
addrobot();
}
void kitscene() { //kitten cutscene, kitscene - if you will
//printf("kitte"); //the most primitive debug of the century
system("cls");
printf("\033[2;1H--------------------------------------------------------------------------------------------------------------------------------");
for (int i = 0; i < 39; i++) {
printf("\033[28;%dH",(9 + i));//kitten section
for (int j = 0; j < 7; j++) { //kitsceen is 7 characters tall
for (int l = 0; l < 19; l++) { //kitsceen is 19 characters long, including \0 //maybe not anymroe
if (kitscenetext[j][l] == '\033') {
printf("\033[%c%cm",kitscenetext[j][(l + 1)],kitscenetext[j][(l + 2)]);
l = l + 2;
} else {
printf("%c", kitscenetext[j][l]);
}
printf("\033[18D \033[B");
}
}
printf("\033[28;%dH",(103 - i));//robot section
for (int j = 0; j < 7; j++) { //kitsceen is 7 characters tall
for (int l = 0; l < 19; l++) { //kitsceen is 19 characters long, including \0
printf("%c", kitscenerobot[j][l]);
}
printf("\033[18D\033[B");
}
Sleep(50); //windows only, fix cross-platfrom with defiens
//printf("%d",i); //debug
}
printf("\033[1;1H \033[1;1H"); //clear line manually because windwos termina lis crap
printf("\033[1;1HAgain? [y/n]");
sleep(1);
int exitchoice = getch();
while(1) { //the stuff inthe while loop make it so only y and n work, instead of arrow keys and such working too probably not the best wayof doing it but its fine for v1
if(exitchoice == 110) {
printf("\033[1;1H \033[1;1H"); //clear line manually because windwos termina lis crap
printf("\033[1;1HYeah, cause DOS is so much better...");
getch();
exit(0);
} else if(exitchoice == 121) {
initialize();
return;
}
exitchoice = getch();
}
}
void objectcollidetext(int i) {
if (i == 30) { //if the object is kitten
kitscene();
return;
} else {
printf("\033[1;1H \033[1;1H"); //clear line manually because windwos termina lis crap
for(int j = 0; j < 128; j++) {
printf("%c",text[(object_text[i])][j]);
}
return;
}
}
void moverobot(int direction) {
switch(direction) {
case 72 : //up
move_stop = 0;
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1));
//for all objects including kitten
//if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((y[31] - 1 == (-1))) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if(((x[31] == x[i]) && ((y[31] - 1) == y[i]))) { //trying to have same coords as an object, or go out of bounds
//printf("\033[1;1H \033[1;1Hfailedup x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
//printf("\033[1;1Hcollided with %d",i); //debug
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
y[31] = y[31] - 1;
//printf("\033[1;1H \033[1;1Hmoveup x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
//printf("\033[1;1H \033[1;1Hmoveup x%d y%d",x[31],y[31]); //debug
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
case 80 : //down
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1));
//for all objects including kitten
//if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((y[31] + 1 == 64)) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if((x[31] == x[i]) && ((y[31] + 1) == y[i])) { //trying to have same coords as an object, or go out of bounds
//printf("\033[1;1H \033[1;1Hfaileddown x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
y[31] = y[31] + 1;
//printf("\033[1;1H \033[1;1Hmovedown x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
//printf("\033[1;1H \033[1;1Hmovedown x%d y%d",x[31],y[31]); //debug
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
case 75 : //left
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1));
//for all objects including kitten
//if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((x[31] - 1 == (-1))) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if(((x[31] - 1) == x[i]) && (y[31] == y[i])) { //trying to have same coords as an object, or go out of bounds
//printf("\033[1;1H \033[1;1Hfailedleft x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
x[31] = x[31] - 1;
//printf("\033[1;1H \033[1;1Hmoveleft x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
//printf("\033[1;1H \033[1;1Hmoveleft x%d y%d",x[31],y[31]); //debug
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
case 77 : //right
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1));
//for all objects including kitten
//if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((x[31] + 1 == 128)) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if(((x[31] + 1) == x[i]) && (y[31] == y[i])) { //trying to have same coords as an object, or go out of bounds
//printf("\033[1;1H \033[1;1Hfailedright x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
x[31] = x[31] + 1;
//printf("\033[1;1H \033[1;1Hmoveright x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
//printf("\033[1;1H \033[1;1Hmoveright x%d y%d",x[31],y[31]); //debug
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
int main() {
initialize();
while(1) {
in = getch();
if (in == 0 || in == 0xE0) in = getch(); //got dang ol windows makes you call functions and arrows keys twice to get the input
switch(in) { //this switch statement is kinda goofy because it only really calls moverobot() but thats got a switch statement in it right away, but now theres other buttons too so its good now
case 72 : //up
moverobot(in);
break;
case 80 : //down
moverobot(in);
break;
case 75 : //left
moverobot(in);
break;
case 77 : //right
moverobot(in);
break;
/*case 49 : //debug
printf("\033[3;1H");//print coords, debug
for (int i = 0; i < 32; i++) {
printf("\033[G \033[Gx%d y%d i%d t%d\n", x[i], y[i], i, object_text[i]);
}
getch();
break;*/
case 49 : //debug
kitscene();
case 50 : //debug
printf("\033");
break;
case 27 : //quit with prompt
printf("\033[1;1HQuit? [y/n]");
if(getch() == 121) {
exit(0);
} else {
break;
}
default :
printf("\a"); //bell, possibly annoying
}
}
}

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,393 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h> //for void hidecursor(), only required on windows
//challenges:
//make this work on any posix machine (use them defines or whatever)
//populate, addrobot, and addkitten could all be put into one function
//add resize and kitten crushing support
//compact printf statemnets
//read texts and kitscene from file
//"kitten printers"
int in = 0;
int objects = 30; //0-29 are objects, 30 is kitten, 31 is robot
int x[31]; int y[31]; //int x[(objects + 2)]; int y[(objects + 2)]; the + 2 makes room for kitten and robot, but these should be excluded from for loops
char object_symbol[31]; //char object_symbol[(objects + 2)];
int object_color[31]; //int object_color[(objects + 2)];
int object_brightness[31]; //int object_brightness[(objects + 2)];
int object_text[29]; //int object_text[(objects + 2)]; //kitten doesnt have text because a cutscene plays and robot doesnt have text cause you cant colide with it
int populate_stop = 1; int addrobot_stop = 1; int addkitten_stop = 1; int move_stop = 1; int text_stop = 1; //stop variables
int texts = 64; char text[64][128] = { //the text for colliding with nkos, might want to minimize this because it will get big
{"Not kitten."},
{"Not a kitten."},
{"A pigeon with a TCP/IP packet taped to it's leg."}, //i like this line too much not to use it
{"Deez."},
{"The Internet, lying in a puddle on the floor"},
{"Your mother's house."},
{"What is it? I don't know."},
{"That one thing. You know what thing I mean."},
{"A magazine full of bullets... it's not the right type of magazine, though."},
{"Someone spilled their drink here!"},
{"Your Advanced Placement Computer Science Principles classroom."},
{"text 11"},
{"This brick wall is missing a brick! Oh, nevermind, it's just been replaced with a Nokia 3310."},
{"A kitten."},
{"A penguin using an operating system you've never seen before."},
{"An open window shining on a computer with an entirely blue screen."}, //objectively bad //16
{"This white apple is hooked up to a mouse, keyboard and monitor... it isn't doing anything."},
{"A pufferfish using an operating system you've never seen before... the pufferfish is puffed up."},
{"A copy of 'The C Programming Language'."},
{"George (the cat)."},
{"An analog clock running on UNIX time."},
{"The table that you always hit your knee on."},
{"A calendar with some classic cars on it for 2022."},
{"Justice, finally!"},
{"A newspaper dated December 6th, 1941... it seems like it was a good day."},
{"Poland."},
{"An old map of Europe... it looks more like pasta than borders."},
{"The RWin key."},
{"It appears to be a... oh, nevermind."},
{"Another robot! Oh, it's just a mirror."},
{"'Kitten's over there', it says."},
{"A large trashcan, filled to the brim with metal chips... you can't move it."}, //32
{"The 32-bit integer limit."},
{"A generic car, endlessly doing donuts."},
{"A bug, causing problems as usual."},
{"#ff00ff"},
{"3 pythons, squirming in place."},
{"A sign says 'Members Only'... you can't tell what the object is."}, //"You must be a member to discover this object."
{"A segme ntation fault."},
{"The goods."},
{"A partridge in a pear tree."},
{"A penguin wearing a tux."},
{"'Mostly sunny'? What, in this void?"},
{"\\033[1;1H"},
{"The metric system."},
{"h."},
{"'Kilroy was here', says Kilroy."},
{"The stack, don't touch it though!"}, //48
{"A TOR node."},
{":)"},
{"The blue cable drive."},
{"You Win! Oh, wait a minute... nevermind."},
{"An external numpad... two keys are worn down."},
{"An X server."},
{"All of your deleted files, in a pile on the ground."},
{"Dexterity."},
{"A bottle of battery acid, essentially poison for robot."},
{"Sweet, some sugar!"},
{"A block of code."},
{"The third dimension."},
{"CDs stacked so high that you can't see the top... they all say something about '500 free hours'."},
{"A computer with glasses and a fake nose... it might be spyware."},
{"This toaster has a few forks sticking out of the top... the toaster is unplugged."},
{"A label firmly stuck to the ground says 'PROPERTY OF THE STATE'."} //64
}; //elegant, i know
char kitscenetext[7][19] = {
{" /\\_____/\\ "},
{" / o o \\ "},
{" ( == ^ == ) "},
{" ) ( "},
{" / \\ "},
{" / / | | \\ \\ "},
{"/__|__|___|__|__\\"},
};
char kitscenerobot[7][19] = {
{" ___ "},
{" |___| "},
{" | | "},
{" \\---|---\\ "},
{" | | "},
{" | "},
{" O--O--O "},
};
time_t t;
void hidecursor() {
HANDLE consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO info;
info.dwSize = 100;
info.bVisible = FALSE;
SetConsoleCursorInfo(consoleHandle, &info);
}
void populate() {
for(int i = 0; i < objects; i++) { //initial position randomization
x[i] = (rand() % 128);
y[i] = (rand() % 64);
object_symbol[i] = ((rand() % 93) + 32); //ansi 33-126
if (rand() % 2) { //picks between the top or bottom 8 colors
object_color[i] = ((rand() % 8) + 31); //color 31-38, 30 is excluded because the background is black and the character would be invisible
} else {
object_color[i] = ((rand() % 8) + 90); //color 90-98
}
object_text[i] = ((rand() % texts)); //text 0-127
}
while(populate_stop) { //check if multiple positions are the same, if so then re-randomize those positions
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if((x[i] == x[j]) && (y[i] == y[j])) {
x[i] = (rand() % 128);
y[i] = (rand() % 64);
} else {
populate_stop = 0;
}
}
}
}
while(text_stop) {
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if(object_text[i] == object_text[j]) {
object_text[i] = ((rand() % texts));
} else {
text_stop = 0;
}
}
}
}
object_text[30] = 0; //kitten always gets 2 for some reason so im making it 0 manually for niceness
for (int i = 0; i < objects; i++) {
printf("\033[%d;%dH\033[%dm%c\033[0m",(y[i] + 3),(x[i] + 1),object_color[i],object_symbol[i]);
}
}
void addkitten() {
x[30] = (rand() % 128);
y[30] = (rand() % 64);
object_symbol[30] = ((rand() % 93) + 32); //ansi 33-126
if (rand() % 2) { //picks between the top or bottom 8 colors
object_color[30] = ((rand() % 8) + 31); //color 31-38, 30 is excluded because the background is black and the character would be invisible
} else {
object_color[30] = ((rand() % 8) + 90); //color 90-98
}
while(addkitten_stop) { //check if multiple positions are the same, if so then re-randomize those positions
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if((x[30] == x[j]) && (y[30] == y[j])) {
x[30] = (rand() % 128);
y[30] = (rand() % 64);
} else {
addkitten_stop = 0;
}
}
}
}
//the kitten printer
printf("\033[%d;%dH\033[%dm\033[107m%c\033[0m",(y[30] + 3),(x[30] + 1),object_color[30],object_symbol[30]); //debug the \033[107m gives kitten a white background for easier identification
//printf("\033[%d;%dH\033[%dm%c\033[0m",(y[30] + 3),(x[30] + 1),object_color[30],object_symbol[30]);
}
void addrobot() {
x[31] = (rand() % 128);
y[31] = (rand() % 64);
object_symbol[31] = 35; //robot is always a bright white #
object_color[31] = 97;
while(addrobot_stop) {
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if((x[31] == x[j]) && (y[31] == y[j])) {
x[31] = (rand() % 128);
y[31] = (rand() % 64);
} else {
addrobot_stop = 0;
}
}
}
}
printf("\033[%d;%dH\033[%dm%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
}
void initialize() {
printf("\033[?25l"); //hides cursor on linux
hidecursor(); //hides cursor on windows
srand(time(t));
system("mode con: cols=128 lines=66");
printf("\033]0;rfk\x1b\x5c"); //set conlse title to rfk
//47, 55, 43, 49 i think
printf("\033[8;40HYou are Robot, and your goal is to find Kitten.\033[9;36HThis is complicated by the exsistance of other objects.\033[10;42HYou must touch an object to see what it is.\033[12;39HUse the arrow keys and press any key to continue.");
getch();
system("cls");
printf("\033[2;1H--------------------------------------------------------------------------------------------------------------------------------");
populate();
addkitten();
addrobot();
}
void kitscene() { //kitten cutscene, kitscene - if you will
//printf("kitte"); //the most primitive debug of the century
system("cls");
printf("\033[2;1H--------------------------------------------------------------------------------------------------------------------------------");
//for (int i = 0; i < 32; i++) {
printf("\033[28;9H");//kitten section
for (int j = 0; j < 7; j++) { //kitsceen is 7 characters tall
for (int l = 0; l < 19; l++) { //kitsceen is 19 characters long, including \0
printf("%c", kitscenetext[j][l]);
}
printf("\033[18D\033[B");
}
printf("\033[28;103H");//robot section
for (int j = 0; j < 7; j++) { //kitsceen is 7 characters tall
for (int l = 0; l < 19; l++) { //kitsceen is 19 characters long, including \0
printf("%c", kitscenerobot[j][l]);
}
printf("\033[18D\033[B");
}
//}
printf("\033[1;1H \033[1;1H"); //clear line manually because windwos termina lis crap
printf("\033[1;1HAgain? [y/n]");
sleep(1);
int exitchoice = getch();
while(1) { //the stuff inthe while loop make it so only y and n work, instead of arrow keys and such working too probably not the best wayof doing it but its fine for v1
if(exitchoice == 110) {
printf("\033[1;1H \033[1;1H"); //clear line manually because windwos termina lis crap
printf("\033[1;1HYeah, cause DOS is so much better...");
getch();
exit(0);
} else if(exitchoice == 121) {
initialize();
return;
}
exitchoice = getch();
}
}
void objectcollidetext(int i) {
if (i == 30) { //if the object is kitten
kitscene();
return;
} else {
printf("\033[1;1H \033[1;1H"); //clear line manually because windwos termina lis crap
for(int j = 0; j < 128; j++) {
printf("%c",text[(object_text[i])][j]);
}
return;
}
}
void moverobot(int direction) {
switch(direction) {
case 72 : //up
move_stop = 0;
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1));
//for all objects including kitten
//if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((y[31] - 1 == (-1))) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if(((x[31] == x[i]) && ((y[31] - 1) == y[i]))) { //trying to have same coords as an object, or go out of bounds
//printf("\033[1;1H \033[1;1Hfailedup x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
//printf("\033[1;1Hcollided with %d",i); //debug
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
y[31] = y[31] - 1;
//printf("\033[1;1H \033[1;1Hmoveup x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
//printf("\033[1;1H \033[1;1Hmoveup x%d y%d",x[31],y[31]); //debug
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
case 80 : //down
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1));
//for all objects including kitten
//if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((y[31] + 1 == 64)) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if((x[31] == x[i]) && ((y[31] + 1) == y[i])) { //trying to have same coords as an object, or go out of bounds
//printf("\033[1;1H \033[1;1Hfaileddown x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
y[31] = y[31] + 1;
//printf("\033[1;1H \033[1;1Hmovedown x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
//printf("\033[1;1H \033[1;1Hmovedown x%d y%d",x[31],y[31]); //debug
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
case 75 : //left
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1));
//for all objects including kitten
//if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((x[31] - 1 == (-1))) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if(((x[31] - 1) == x[i]) && (y[31] == y[i])) { //trying to have same coords as an object, or go out of bounds
//printf("\033[1;1H \033[1;1Hfailedleft x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
x[31] = x[31] - 1;
//printf("\033[1;1H \033[1;1Hmoveleft x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
//printf("\033[1;1H \033[1;1Hmoveleft x%d y%d",x[31],y[31]); //debug
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
case 77 : //right
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1));
//for all objects including kitten
//if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((x[31] + 1 == 128)) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if(((x[31] + 1) == x[i]) && (y[31] == y[i])) { //trying to have same coords as an object, or go out of bounds
//printf("\033[1;1H \033[1;1Hfailedright x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
x[31] = x[31] + 1;
//printf("\033[1;1H \033[1;1Hmoveright x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
//printf("\033[1;1H \033[1;1Hmoveright x%d y%d",x[31],y[31]); //debug
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
int main() {
initialize();
while(1) {
in = getch();
if (in == 0 || in == 0xE0) in = getch(); //got dang ol windows makes you call functions and arrows keys twice to get the input
switch(in) { //this switch statement is kinda goofy because it only really calls moverobot() but thats got a switch statement in it right away, but now theres other buttons too so its good now
case 72 : //up
moverobot(in);
break;
case 80 : //down
moverobot(in);
break;
case 75 : //left
moverobot(in);
break;
case 77 : //right
moverobot(in);
break;
/*case 49 : //debug
printf("\033[3;1H");//print coords, debug
for (int i = 0; i < 32; i++) {
printf("\033[G \033[Gx%d y%d i%d t%d\n", x[i], y[i], i, object_text[i]);
}
getch();
break;*/
case 27 : //quit with prompt
printf("\033[1;1HQuit? [y/n]");
if(getch() == 121) {
exit(0);
}
default :
printf("\a"); //bell, possibly annoying
}
}
}

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,437 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h> //for void hidecursor(), only required on windows
//challenges:
//make this work on any posix machine (use them defines or whatever)
//populate, addrobot, and addkitten could all be put into one function
//add resize and kitten crushing support
//compact printf statemnets
//read texts and kitscene from file
//"kitten printers"
int in = 0;
int objects = 30; //0-29 are objects, 30 is kitten, 31 is robot
int x[31]; int y[31]; //int x[(objects + 2)]; int y[(objects + 2)]; the + 2 makes room for kitten and robot, but these should be excluded from for loops
char object_symbol[31]; //char object_symbol[(objects + 2)];
int object_color[31]; //int object_color[(objects + 2)];
int object_brightness[31]; //int object_brightness[(objects + 2)];
int object_text[29]; //int object_text[(objects + 2)]; //kitten doesnt have text because a cutscene plays and robot doesnt have text cause you cant colide with it
int populate_stop = 1; int addrobot_stop = 1; int addkitten_stop = 1; int move_stop = 1; int text_stop = 1; //stop variables
int texts = 64; char text[64][128] = { //the text for colliding with nkos, might want to minimize this because it will get big
{"Not kitten."},
{"Not a kitten."},
{"A pigeon with a TCP/IP packet taped to it's leg."}, //i like this line too much not to use it
{"Deez."},
{"The Internet, lying in a puddle on the floor"},
{"Your mother's house."},
{"What is it? I don't know."},
{"That one thing. You know what thing I mean."},
{"A magazine full of bullets... it's not the right type of magazine, though."},
{"Someone spilled their drink here!"},
{"Your Advanced Placement Computer Science Principles classroom."},
{"text 11"},
{"This brick wall is missing a brick! Oh, nevermind, it's just been replaced with a Nokia 3310."},
{"A kitten."},
{"A penguin using an operating system you've never seen before."},
{"An open window shining on a computer with an entirely blue screen."}, //objectively bad //16
{"This white apple is hooked up to a mouse, keyboard and monitor... it isn't doing anything."},
{"A pufferfish using an operating system you've never seen before... the pufferfish is puffed up."},
{"A copy of 'The C Programming Language'."},
{"George (the cat)."},
{"An analog clock running on UNIX time."},
{"The table that you always hit your knee on."},
{"A calendar with some classic cars on it for 2022."},
{"Justice, finally!"},
{"A newspaper dated December 6th, 1941... it seems like it was a good day."},
{"Poland."},
{"An old map of Europe... it looks more like pasta than borders."},
{"The RWin key."},
{"It appears to be a... oh, nevermind."},
{"Another robot! Oh, it's just a mirror."},
{"'Kitten's over there', it says."},
{"A large trashcan, filled to the brim with metal chips... you can't move it."}, //32
{"The 32-bit integer limit."},
{"A generic car, endlessly doing donuts."},
{"A bug, causing problems as usual."},
{"#ff00ff"},
{"3 pythons, squirming in place."},
{"A sign says 'Members Only'... you can't tell what the object is."}, //"You must be a member to discover this object."
{"A segme ntation fault."},
{"The goods."},
{"A partridge in a pear tree."},
{"A penguin wearing a tux."},
{"'Mostly sunny'? What, in this void?"},
{"\\033[1;1H"},
{"The metric system."},
{"h."},
{"'Kilroy was here', says Kilroy."},
{"The stack, don't touch it though!"}, //48
{"A TOR node."},
{":)"},
{"The blue cable drive."},
{"You Win! Oh, wait a minute... nevermind."},
{"An external numpad... two keys are worn down."},
{"An X server."},
{"All of your deleted files, in a pile on the ground."},
{"Dexterity."},
{"A bottle of battery acid, essentially poison for robot."},
{"Sweet, some sugar!"},
{"A block of code."},
{"The third dimension."},
{"CDs stacked so high that you can't see the top... they all say something about '500 free hours'."},
{"A computer with glasses and a fake nose... it might be spyware."},
{"This toaster has a few forks sticking out of the top... the toaster is unplugged."},
{"A label firmly stuck to the ground says 'PROPERTY OF THE STATE'."} //64
}; //elegant, i know
char kitscenetext[7][21] = {
{" `/\\_____/\\ "}, //`oragne .green ,reset
{" / .o o` \\ "},
{" ( ,== `^ ,== `) "},
{" ) ( "},
{" / \\ "},
{" / / | | \\ \\ "},
{"/__|__|___|__|__\\,"},
};
/*char kitscenetext[7][19] = {
{" /\\_____/\\ "},
{" / o o \\ "},
{" ( == ^ == ) "},
{" ) ( "},
{" / \\ "},
{" / / | | \\ \\ "},
{"/__|__|___|__|__\\"},
};*/
char kitscenerobot[7][19] = {
{" `___ "}, //`grey .red ,reset
{" |_@_| "},
{" | | "},
{" \\---|---\\ "},
{" | | "},
{" | "},
{" O--O--O "},
};
time_t t;
void hidecursor() {
HANDLE consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO info;
info.dwSize = 100;
info.bVisible = FALSE;
SetConsoleCursorInfo(consoleHandle, &info);
}
void populate() {
for(int i = 0; i < objects; i++) { //initial position randomization
x[i] = (rand() % 128);
y[i] = (rand() % 64);
object_symbol[i] = ((rand() % 93) + 32); //ansi 33-126
if (rand() % 2) { //picks between the top or bottom 8 colors
object_color[i] = ((rand() % 8) + 31); //color 31-38, 30 is excluded because the background is black and the character would be invisible
} else {
object_color[i] = ((rand() % 8) + 90); //color 90-98
}
object_text[i] = ((rand() % texts)); //text 0-127
}
while(populate_stop) { //check if multiple positions are the same, if so then re-randomize those positions
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if((x[i] == x[j]) && (y[i] == y[j])) {
x[i] = (rand() % 128);
y[i] = (rand() % 64);
} else {
populate_stop = 0;
}
}
}
}
while(text_stop) {
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if(object_text[i] == object_text[j]) {
object_text[i] = ((rand() % texts));
} else {
text_stop = 0;
}
}
}
}
object_text[30] = 0; //kitten always gets 2 for some reason so im making it 0 manually for niceness
for (int i = 0; i < objects; i++) {
printf("\033[%d;%dH\033[%dm%c\033[0m",(y[i] + 3),(x[i] + 1),object_color[i],object_symbol[i]);
}
}
void addkitten() {
x[30] = (rand() % 128);
y[30] = (rand() % 64);
object_symbol[30] = ((rand() % 93) + 32); //ansi 33-126
if (rand() % 2) { //picks between the top or bottom 8 colors
object_color[30] = ((rand() % 8) + 31); //color 31-38, 30 is excluded because the background is black and the character would be invisible
} else {
object_color[30] = ((rand() % 8) + 90); //color 90-98
}
while(addkitten_stop) { //check if multiple positions are the same, if so then re-randomize those positions
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if((x[30] == x[j]) && (y[30] == y[j])) {
x[30] = (rand() % 128);
y[30] = (rand() % 64);
} else {
addkitten_stop = 0;
}
}
}
}
//the kitten printer
printf("\033[%d;%dH\033[%dm\033[107m%c\033[0m",(y[30] + 3),(x[30] + 1),object_color[30],object_symbol[30]); //debug the \033[107m gives kitten a white background for easier identification
//printf("\033[%d;%dH\033[%dm%c\033[0m",(y[30] + 3),(x[30] + 1),object_color[30],object_symbol[30]);
}
void addrobot() {
x[31] = (rand() % 128);
y[31] = (rand() % 64);
object_symbol[31] = 35; //robot is always a bright white #
object_color[31] = 97;
while(addrobot_stop) {
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if((x[31] == x[j]) && (y[31] == y[j])) {
x[31] = (rand() % 128);
y[31] = (rand() % 64);
} else {
addrobot_stop = 0;
}
}
}
}
printf("\033[%d;%dH\033[%dm%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
}
void initialize() {
printf("\033[?25l"); //hides cursor on linux
hidecursor(); //hides cursor on windows
srand(time(t));
system("mode con: cols=128 lines=66");
printf("\033]0;rfk\x1b\x5c"); //set conlse title to rfk
//47, 55, 43, 49 i think
printf("\033[8;40HYou are Robot, and your goal is to find Kitten.\033[9;36HThis is complicated by the exsistance of other objects.\033[10;42HYou must touch an object to see what it is.\033[12;39HUse the arrow keys and press any key to continue.");
getch();
system("cls");
printf("\033[2;1H--------------------------------------------------------------------------------------------------------------------------------");
populate();
addkitten();
addrobot();
}
void kitscene() { //kitten cutscene, kitscene - if you will
//printf("kitte"); //the most primitive debug of the century
system("cls");
printf("\033[2;1H--------------------------------------------------------------------------------------------------------------------------------");
for (int i = 0; i < 39; i++) {
printf("\033[28;%dH",(9 + i));//kitten section
for (int j = 0; j < 7; j++) { //kitsceen is 7 characters tall
for (int l = 0; l < 21; l++) { //kitsceen is 19 characters long, including \0 //maybe not anymroe
switch(kitscenetext[j][l]) {
case '`':
printf("\033[33m");
break;
case '.':
printf("\033[32m");
break;
case ',':
printf("\033[0m");
break;
default:
printf("%c", kitscenetext[j][l]);
break;
}
}
printf("\033[18D \033[B");
}
printf("\033[28;%dH",(103 - i));//robot section
for (int j = 0; j < 7; j++) { //kitsceen is 7 characters tall
for (int l = 0; l < 19; l++) { //kitsceen is 19 characters long, including \0
switch(kitscenerobot[j][l]) {
case '`':
printf("\033[90m");
break;
case '.':
printf("\033[31m");
break;
case ',':
printf("\033[0m");
break;
default:
printf("%c", kitscenetext[j][l]);
break;
}
}
printf("\033[18D\033[B");
}
Sleep(50); //windows only, fix cross-platfrom with defiens
//printf("%d",i); //debug
}
printf("\033[1;1H \033[1;1H"); //clear line manually because windwos termina lis crap
printf("\033[1;1HAgain? [y/n]");
sleep(1);
int exitchoice = getch();
while(1) { //the stuff inthe while loop make it so only y and n work, instead of arrow keys and such working too probably not the best wayof doing it but its fine for v1
if(exitchoice == 110) {
printf("\033[1;1H \033[1;1H"); //clear line manually because windwos termina lis crap
printf("\033[1;1HYeah, cause DOS is so much better...");
getch();
exit(0);
} else if(exitchoice == 121) {
initialize();
return;
}
exitchoice = getch();
}
}
void objectcollidetext(int i) {
if (i == 30) { //if the object is kitten
kitscene();
return;
} else {
printf("\033[1;1H \033[1;1H"); //clear line manually because windwos termina lis crap
for(int j = 0; j < 128; j++) {
printf("%c",text[(object_text[i])][j]);
}
return;
}
}
void moverobot(int direction) {
switch(direction) {
case 72 : //up
move_stop = 0;
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1));
//for all objects including kitten
//if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((y[31] - 1 == (-1))) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if(((x[31] == x[i]) && ((y[31] - 1) == y[i]))) { //trying to have same coords as an object, or go out of bounds
//printf("\033[1;1H \033[1;1Hfailedup x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
//printf("\033[1;1Hcollided with %d",i); //debug
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
y[31] = y[31] - 1;
//printf("\033[1;1H \033[1;1Hmoveup x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
//printf("\033[1;1H \033[1;1Hmoveup x%d y%d",x[31],y[31]); //debug
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
case 80 : //down
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1));
//for all objects including kitten
//if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((y[31] + 1 == 64)) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if((x[31] == x[i]) && ((y[31] + 1) == y[i])) { //trying to have same coords as an object, or go out of bounds
//printf("\033[1;1H \033[1;1Hfaileddown x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
y[31] = y[31] + 1;
//printf("\033[1;1H \033[1;1Hmovedown x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
//printf("\033[1;1H \033[1;1Hmovedown x%d y%d",x[31],y[31]); //debug
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
case 75 : //left
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1));
//for all objects including kitten
//if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((x[31] - 1 == (-1))) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if(((x[31] - 1) == x[i]) && (y[31] == y[i])) { //trying to have same coords as an object, or go out of bounds
//printf("\033[1;1H \033[1;1Hfailedleft x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
x[31] = x[31] - 1;
//printf("\033[1;1H \033[1;1Hmoveleft x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
//printf("\033[1;1H \033[1;1Hmoveleft x%d y%d",x[31],y[31]); //debug
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
case 77 : //right
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1));
//for all objects including kitten
//if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((x[31] + 1 == 128)) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if(((x[31] + 1) == x[i]) && (y[31] == y[i])) { //trying to have same coords as an object, or go out of bounds
//printf("\033[1;1H \033[1;1Hfailedright x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
x[31] = x[31] + 1;
//printf("\033[1;1H \033[1;1Hmoveright x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
//printf("\033[1;1H \033[1;1Hmoveright x%d y%d",x[31],y[31]); //debug
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
int main() {
initialize();
while(1) {
in = getch();
if (in == 0 || in == 0xE0) in = getch(); //got dang ol windows makes you call functions and arrows keys twice to get the input
switch(in) { //this switch statement is kinda goofy because it only really calls moverobot() but thats got a switch statement in it right away, but now theres other buttons too so its good now
case 72 : //up
moverobot(in);
break;
case 80 : //down
moverobot(in);
break;
case 75 : //left
moverobot(in);
break;
case 77 : //right
moverobot(in);
break;
/*case 49 : //debug
printf("\033[3;1H");//print coords, debug
for (int i = 0; i < 32; i++) {
printf("\033[G \033[Gx%d y%d i%d t%d\n", x[i], y[i], i, object_text[i]);
}
getch();
break;*/
case 49 : //debug
kitscene();
case 50 : //debug
printf("\033");
break;
case 27 : //quit with prompt
printf("\033[1;1HQuit? [y/n]");
if(getch() == 121) {
exit(0);
} else {
break;
}
default :
printf("\a"); //bell, possibly annoying
}
}
}

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

BIN
everything else/printtest.o Normal file

Binary file not shown.

View File

@ -0,0 +1,428 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h> //for void hidecursor(), only required on windows
//challenges:
//make this work on any posix machine (use them defines or whatever)
//populate, addrobot, and addkitten could all be put into one function
//add resize and kitten crushing support
//compact printf statemnets
//read texts and kitscene from file
//"kitten printers"
int in = 0;
int objects = 30; //0-29 are objects, 30 is kitten, 31 is robot
int x[31]; int y[31]; //int x[(objects + 2)]; int y[(objects + 2)]; the + 2 makes room for kitten and robot, but these should be excluded from for loops
char object_symbol[31]; //char object_symbol[(objects + 2)];
int object_color[31]; //int object_color[(objects + 2)];
int object_brightness[31]; //int object_brightness[(objects + 2)];
int object_text[29]; //int object_text[(objects + 2)]; //kitten doesnt have text because a cutscene plays and robot doesnt have text cause you cant colide with it
int populate_stop = 1; int addrobot_stop = 1; int addkitten_stop = 1; int move_stop = 1; int text_stop = 1; //stop variables
int texts = 64; char text[64][128] = { //the text for colliding with nkos, might want to minimize this because it will get big
{"Not kitten."},
{"Not a kitten."},
{"A pigeon with a TCP/IP packet taped to it's leg."}, //i like this line too much not to use it
{"Deez."},
{"The Internet, lying in a puddle on the floor"},
{"Your mother's house."},
{"What is it? I don't know."},
{"That one thing. You know what thing I mean."},
{"A magazine full of bullets... it's not the right type of magazine, though."},
{"Someone spilled their drink here!"},
{"Your Advanced Placement Computer Science Principles classroom."},
{"text 11"},
{"This brick wall is missing a brick! Oh, nevermind, it's just been replaced with a Nokia 3310."},
{"A kitten."},
{"A penguin using an operating system you've never seen before."},
{"An open window shining on a computer with an entirely blue screen."}, //objectively bad //16
{"This white apple is hooked up to a mouse, keyboard and monitor... it isn't doing anything."},
{"A pufferfish using an operating system you've never seen before... the pufferfish is puffed up."},
{"A copy of 'The C Programming Language'."},
{"George (the cat)."},
{"An analog clock running on UNIX time."},
{"The table that you always hit your knee on."},
{"A calendar with some classic cars on it for 2022."},
{"Justice, finally!"},
{"A newspaper dated December 6th, 1941... it seems like it was a good day."},
{"Poland."},
{"An old map of Europe... it looks more like pasta than borders."},
{"The RWin key."},
{"It appears to be a... oh, nevermind."},
{"Another robot! Oh, it's just a mirror."},
{"'Kitten's over there', it says."},
{"A large trashcan, filled to the brim with metal chips... you can't move it."}, //32
{"The 32-bit integer limit."},
{"A generic car, endlessly doing donuts."},
{"A bug, causing problems as usual."},
{"#ff00ff"},
{"3 pythons, squirming in place."},
{"A sign says 'Members Only'... you can't tell what the object is."}, //"You must be a member to discover this object."
{"A segme ntation fault."},
{"The goods."},
{"A partridge in a pear tree."},
{"A penguin wearing a tux."},
{"'Mostly sunny'? What, in this void?"},
{"\\033[1;1H"},
{"The metric system."},
{"h."},
{"'Kilroy was here', says Kilroy."},
{"The stack, don't touch it though!"}, //48
{"A TOR node."},
{":)"},
{"The blue cable drive."},
{"You Win! Oh, wait a minute... nevermind."},
{"An external numpad... two keys are worn down."},
{"An X server."},
{"All of your deleted files, in a pile on the ground."},
{"Dexterity."},
{"A bottle of battery acid, essentially poison for robot."},
{"Sweet, some sugar!"},
{"A block of code."},
{"The third dimension."},
{"CDs stacked so high that you can't see the top... they all say something about '500 free hours'."},
{"A computer with glasses and a fake nose... it might be spyware."},
{"This toaster has a few forks sticking out of the top... the toaster is unplugged."},
{"A label firmly stuck to the ground says 'PROPERTY OF THE STATE'."} //64
}; //elegant, i know
char kitscenetext[7][21] = {
{" `/\\_____/\\ "}, //`oragne .green ,reset
{" / .o o` \\ "},
{" ( ,== `^ ,== `) "},
{" ) ( "},
{" / \\ "},
{" / / | | \\ \\ "},
{"/__|__|___|__|__\\,"},
};
char kitscenerobot[7][19] = {
{" `___ "}, //`grey .red ,reset
{" |_.@`_| "},
{" | | "},
{" \\---|---\\ "},
{" | | "},
{" | "},
{" O--O--O, "},
};
time_t t;
void hidecursor() { //i hate windows, and you do too
HANDLE consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO info;
info.dwSize = 100;
info.bVisible = FALSE;
SetConsoleCursorInfo(consoleHandle, &info);
}
void populate() {
for(int i = 0; i < objects; i++) { //initial position randomization
x[i] = (rand() % 128);
y[i] = (rand() % 64);
object_symbol[i] = ((rand() % 93) + 32); //ansi 33-126
if (rand() % 2) { //picks between the top or bottom 8 colors
object_color[i] = ((rand() % 8) + 31); //color 31-38, 30 is excluded because the background is black and the character would be invisible
} else {
object_color[i] = ((rand() % 8) + 90); //color 90-98
}
object_text[i] = ((rand() % texts)); //text 0-127
}
while(populate_stop) { //check if multiple positions are the same, if so then re-randomize those positions
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if((x[i] == x[j]) && (y[i] == y[j])) {
x[i] = (rand() % 128);
y[i] = (rand() % 64);
} else {
populate_stop = 0;
}
}
}
}
while(text_stop) {
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if(object_text[i] == object_text[j]) {
object_text[i] = ((rand() % texts));
} else {
text_stop = 0;
}
}
}
}
object_text[30] = 0; //kitten always gets 2 for some reason so im making it 0 manually for niceness
for (int i = 0; i < objects; i++) {
printf("\033[%d;%dH\033[%dm%c\033[0m",(y[i] + 3),(x[i] + 1),object_color[i],object_symbol[i]);
}
}
void addkitten() {
x[30] = (rand() % 128);
y[30] = (rand() % 64);
object_symbol[30] = ((rand() % 93) + 32); //ansi 33-126
if (rand() % 2) { //picks between the top or bottom 8 colors
object_color[30] = ((rand() % 8) + 31); //color 31-38, 30 is excluded because the background is black and the character would be invisible
} else {
object_color[30] = ((rand() % 8) + 90); //color 90-98
}
while(addkitten_stop) { //check if multiple positions are the same, if so then re-randomize those positions
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if((x[30] == x[j]) && (y[30] == y[j])) {
x[30] = (rand() % 128);
y[30] = (rand() % 64);
} else {
addkitten_stop = 0;
}
}
}
}
//the kitten printer
//printf("\033[%d;%dH\033[%dm\033[107m%c\033[0m",(y[30] + 3),(x[30] + 1),object_color[30],object_symbol[30]); //debug the \033[107m gives kitten a white background for easier identification
printf("\033[%d;%dH\033[%dm%c\033[0m",(y[30] + 3),(x[30] + 1),object_color[30],object_symbol[30]);
}
void addrobot() {
x[31] = (rand() % 128);
y[31] = (rand() % 64);
object_symbol[31] = 35; //robot is always a bright white #
object_color[31] = 97;
while(addrobot_stop) {
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if((x[31] == x[j]) && (y[31] == y[j])) {
x[31] = (rand() % 128);
y[31] = (rand() % 64);
} else {
addrobot_stop = 0;
}
}
}
}
printf("\033[%d;%dH\033[%dm%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
}
void initialize() {
printf("\033[?25l"); //hides cursor on linux
hidecursor(); //hides cursor on windows
srand(time(t));
system("mode con: cols=128 lines=66");
printf("\033]0;rfk\x1b\x5c"); //set conlse title to rfk
//47, 55, 43, 49 i think
printf("\033[8;40HYou are Robot, and your goal is to find Kitten.\033[9;36HThis is complicated by the exsistance of other objects.\033[10;42HYou must touch an object to see what it is.\033[12;39HUse the arrow keys and press any key to continue.");
getch();
system("cls");
printf("\033[2;1H--------------------------------------------------------------------------------------------------------------------------------");
populate();
addkitten();
addrobot();
}
void kitscene() { //kitten cutscene, kitscene - if you will
//printf("kitte"); //the most primitive debug of the century
system("cls");
printf("\033[2;1H--------------------------------------------------------------------------------------------------------------------------------");
for (int i = 0; i < 39; i++) {
printf("\033[28;%dH",(8 + i));//kitten section
for (int j = 0; j < 7; j++) { //kitsceen is 7 characters tall
for (int l = 0; l < 21; l++) { //kitsceen is 19 characters long, including \0 //maybe not anymroe
switch(kitscenetext[j][l]) {
case '`':
printf("\033[33m");
break;
case '.':
printf("\033[32m");
break;
case ',':
printf("\033[0m");
break;
default:
printf("%c", kitscenetext[j][l]);
break;
}
}
printf("\033[18D \033[B");
}
printf("\033[28;%dH",(103 - i));//robot section
for (int j = 0; j < 7; j++) { //kitsceen is 7 characters tall
for (int l = 0; l < 19; l++) { //kitsceen is 19 characters long, including \0
switch(kitscenerobot[j][l]) {
case '`':
printf("\033[90m");
break;
case '.':
printf("\033[31m");
break;
case ',':
printf("\033[0m");
break;
default:
printf("%c", kitscenerobot[j][l]);
break;
}
}
printf("\033[18D\033[B");
}
Sleep(50); //windows only, fix cross-platfrom with defiens
//printf("%d",i); //debug
}
printf("\033[1;1H \033[1;1H"); //clear line manually because windwos termina lis crap
printf("\033[1;1HAgain? [y/n]");
sleep(1);
int exitchoice = getch();
while(1) { //the stuff inthe while loop make it so only y and n work, instead of arrow keys and such working too probably not the best wayof doing it but its fine for v1
if(exitchoice == 110) {
printf("\033[1;1H \033[1;1H"); //clear line manually because windwos termina lis crap
printf("\033[1;1HYeah, cause DOS is so much better...");
getch();
exit(0);
} else if(exitchoice == 121) {
initialize();
return;
}
exitchoice = getch();
}
}
void objectcollidetext(int i) {
if (i == 30) { //if the object is kitten
kitscene();
return;
} else {
printf("\033[1;1H \033[1;1H"); //clear line manually because windwos termina lis crap
for(int j = 0; j < 128; j++) {
printf("%c",text[(object_text[i])][j]);
}
return;
}
}
void moverobot(int direction) {
switch(direction) {
case 72 : //up
move_stop = 0;
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1));
//for all objects including kitten
//if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((y[31] - 1 == (-1))) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if(((x[31] == x[i]) && ((y[31] - 1) == y[i]))) { //trying to have same coords as an object, or go out of bounds
//printf("\033[1;1H \033[1;1Hfailedup x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
//printf("\033[1;1Hcollided with %d",i); //debug
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
y[31] = y[31] - 1;
//printf("\033[1;1H \033[1;1Hmoveup x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
//printf("\033[1;1H \033[1;1Hmoveup x%d y%d",x[31],y[31]); //debug
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
case 80 : //down
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1));
//for all objects including kitten
//if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((y[31] + 1 == 64)) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if((x[31] == x[i]) && ((y[31] + 1) == y[i])) { //trying to have same coords as an object, or go out of bounds
//printf("\033[1;1H \033[1;1Hfaileddown x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
y[31] = y[31] + 1;
//printf("\033[1;1H \033[1;1Hmovedown x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
//printf("\033[1;1H \033[1;1Hmovedown x%d y%d",x[31],y[31]); //debug
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
case 75 : //left
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1));
//for all objects including kitten
//if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((x[31] - 1 == (-1))) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if(((x[31] - 1) == x[i]) && (y[31] == y[i])) { //trying to have same coords as an object, or go out of bounds
//printf("\033[1;1H \033[1;1Hfailedleft x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
x[31] = x[31] - 1;
//printf("\033[1;1H \033[1;1Hmoveleft x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
//printf("\033[1;1H \033[1;1Hmoveleft x%d y%d",x[31],y[31]); //debug
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
case 77 : //right
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1));
//for all objects including kitten
//if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((x[31] + 1 == 128)) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if(((x[31] + 1) == x[i]) && (y[31] == y[i])) { //trying to have same coords as an object, or go out of bounds
//printf("\033[1;1H \033[1;1Hfailedright x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
x[31] = x[31] + 1;
//printf("\033[1;1H \033[1;1Hmoveright x%d y%d xcheck%d ycheck%d %d",x[31],y[31],(x[31] == x[i]),((y[31] - 1) == y[i]), i); //debug
//printf("\033[1;1H \033[1;1Hmoveright x%d y%d",x[31],y[31]); //debug
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
int main() {
initialize();
while(1) {
in = getch();
if (in == 0 || in == 0xE0) in = getch(); //got dang ol windows makes you call functions and arrows keys twice to get the input
switch(in) { //this switch statement is kinda goofy because it only really calls moverobot() but thats got a switch statement in it right away, but now theres other buttons too so its good now
case 72 : //up
moverobot(in);
break;
case 80 : //down
moverobot(in);
break;
case 75 : //left
moverobot(in);
break;
case 77 : //right
moverobot(in);
break;
/*case 49 : //debug
printf("\033[3;1H");//print coords, debug
for (int i = 0; i < 32; i++) {
printf("\033[G \033[Gx%d y%d i%d t%d\n", x[i], y[i], i, object_text[i]);
}
getch();
break;*/
/*case 49 : //debug
kitscene();
case 50 : //debug
printf("\033");
break;*/
case 27 : //quit with prompt
printf("\033[1;1HQuit? [y/n]");
if(getch() == 121) {
exit(0);
} else {
break;
}
default :
printf("\a"); //bell, possibly annoying
}
}
}

Binary file not shown.

392
everything else/rfk-final.c Normal file
View File

@ -0,0 +1,392 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h> //for void hidecursor(), only required on windows
//"kitten printers"
int in = 0;
int objects = 30; //0-29 are objects, 30 is kitten, 31 is robot
int x[31]; int y[31]; //int x[(objects + 2)]; int y[(objects + 2)]; the + 2 makes room for kitten and robot, but these should be excluded from for loops
char object_symbol[31]; //char object_symbol[(objects + 2)];
int object_color[31]; //int object_color[(objects + 2)];
int object_brightness[31]; //int object_brightness[(objects + 2)];
int object_text[29]; //int object_text[(objects + 2)]; //kitten doesnt have text because a cutscene plays and robot doesnt have text cause you cant colide with it
int populate_stop = 1; int addrobot_stop = 1; int addkitten_stop = 1; int move_stop = 1; int text_stop = 1; //stop variables
int texts = 64; char text[64][128] = { //the text for colliding with nkos, might want to minimize this because it will get big
{"Not kitten."},
{"Not a kitten."},
{"A pigeon with a TCP/IP packet taped to it's leg."}, //i like this line too much not to use it
{"Deez."},
{"The Internet, lying in a puddle on the floor."},
{"Your mother's house."},
{"What is it? I don't know."},
{"That one thing. You know what thing I mean."},
{"A magazine full of bullets... it's not the right type of magazine, though."},
{"Someone spilled their drink here!"},
{"Your Advanced Placement Computer Science Principles classroom."},
{"text 11"},
{"This brick wall is missing a brick! Oh, nevermind, it's just been replaced with a Nokia 3310."},
{"A kitten."},
{"A penguin using an operating system you've never seen before."},
{"An open window shining on a computer with an entirely blue screen."}, //objectively bad //16
{"This white apple is hooked up to a mouse, keyboard and monitor... it isn't doing anything."},
{"A pufferfish using an operating system you've never seen before... the pufferfish is puffed up."},
{"A copy of 'The C Programming Language'."},
{"George (the cat)."},
{"An analog clock running on UNIX time."},
{"The table that you always hit your knee on."},
{"A calendar with some classic cars on it for 2022."},
{"Justice, finally!"},
{"A newspaper dated December 6th, 1941... it seems like it was a good day."},
{"Poland."},
{"An old map of Europe... it looks more like pasta than borders."},
{"The RWin key."},
{"It appears to be a... oh, nevermind."},
{"Another robot! Oh, it's just a mirror."},
{"'Kitten's over there', it says."},
{"A large trashcan, filled to the brim with metal chips... you can't move it."}, //32
{"The 32-bit integer limit."},
{"A generic car, endlessly doing donuts."},
{"A bug, causing problems as usual."},
{"#ff00ff"},
{"3 pythons, squirming in place."},
{"A sign says 'Members Only'... you can't tell what the object is."}, //"You must be a member to discover this object."
{"A segme ntation fault."},
{"The goods."},
{"A partridge in a pear tree."},
{"A penguin wearing a tux."},
{"'Mostly sunny'? What, in this void?"},
{"\\033[1;1H"},
{"The metric system."},
{"h."},
{"'Kilroy was here', says Kilroy."},
{"The stack, don't touch it though!"}, //48
{"A TOR node."},
{":)"},
{"The blue cable drive."},
{"You Win! Oh, wait a minute... nevermind."},
{"An external numpad... two keys are worn down."},
{"An X server."},
{"All of your deleted files, in a pile on the ground."},
{"Dexterity."},
{"A bottle of battery acid, essentially poison for robot."},
{"Sweet, some sugar!"},
{"A block of code."},
{"The third dimension."},
{"CDs stacked so high that you can't see the top... they all say something about '500 free hours'."},
{"A computer with glasses and a fake nose... it might be spyware."},
{"This toaster has a few forks sticking out of the top... the toaster is unplugged."},
{"A label firmly stuck to the ground says 'PROPERTY OF THE STATE'."} //64
}; //elegant, i know
char kitscenetext[7][21] = {
{" `/\\_____/\\ "}, //`oragne .green ,reset
{" / .o o` \\ "},
{" ( ,== `^ ,== `) "},
{" ) ( "},
{" / \\ "},
{" / / | | \\ \\ "},
{"/__|__|___|__|__\\,"},
};
char kitscenerobot[7][19] = {
{" `___ "}, //`grey .red ,reset
{" |_.@`_| "},
{" | | "},
{" \\---|---\\ "},
{" | | "},
{" | "},
{" O--O--O, "},
};
time_t t;
void hidecursor() { //i hate windows, and you do too
HANDLE consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO info;
info.dwSize = 100;
info.bVisible = FALSE;
SetConsoleCursorInfo(consoleHandle, &info);
}
void populate() {
for(int i = 0; i < objects; i++) { //initial position randomization
x[i] = (rand() % 128);
y[i] = (rand() % 64);
object_symbol[i] = ((rand() % 93) + 32); //ansi 33-126
if (rand() % 2) { //picks between the top or bottom 8 colors
object_color[i] = ((rand() % 8) + 31); //color 31-38, 30 is excluded because the background is black and the character would be invisible
} else {
object_color[i] = ((rand() % 8) + 90); //color 90-98
}
object_text[i] = ((rand() % texts)); //text 0-127
}
while(populate_stop) { //check if multiple positions are the same, if so then re-randomize those positions
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if((x[i] == x[j]) && (y[i] == y[j])) {
x[i] = (rand() % 128);
y[i] = (rand() % 64);
} else {
populate_stop = 0;
}
}
}
}
while(text_stop) {
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if(object_text[i] == object_text[j]) {
object_text[i] = ((rand() % texts));
} else {
text_stop = 0;
}
}
}
}
object_text[30] = 0; //kitten always gets 2 for some reason so im making it 0 manually for niceness
for (int i = 0; i < objects; i++) {
printf("\033[%d;%dH\033[%dm%c\033[0m",(y[i] + 3),(x[i] + 1),object_color[i],object_symbol[i]);
}
}
void addkitten() {
x[30] = (rand() % 128);
y[30] = (rand() % 64);
object_symbol[30] = ((rand() % 93) + 32); //ansi 33-126
if (rand() % 2) { //picks between the top or bottom 8 colors
object_color[30] = ((rand() % 8) + 31); //color 31-38, 30 is excluded because the background is black and the character would be invisible
} else {
object_color[30] = ((rand() % 8) + 90); //color 90-98
}
while(addkitten_stop) { //check if multiple positions are the same, if so then re-randomize those positions
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if((x[30] == x[j]) && (y[30] == y[j])) {
x[30] = (rand() % 128);
y[30] = (rand() % 64);
} else {
addkitten_stop = 0;
}
}
}
}
//the kitten printer
printf("\033[%d;%dH\033[%dm%c\033[0m",(y[30] + 3),(x[30] + 1),object_color[30],object_symbol[30]);
}
void addrobot() {
x[31] = (rand() % 128);
y[31] = (rand() % 64);
object_symbol[31] = 35; //robot is always a bright white #
object_color[31] = 97;
while(addrobot_stop) {
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if((x[31] == x[j]) && (y[31] == y[j])) {
x[31] = (rand() % 128);
y[31] = (rand() % 64);
} else {
addrobot_stop = 0;
}
}
}
}
printf("\033[%d;%dH\033[%dm%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
}
void initialize() {
hidecursor(); //hides cursor on windows
srand(time(t));
system("mode con: cols=128 lines=66");
printf("\033]0;rfk\x1b\x5c"); //set conlse title to rfk
printf("\033[8;40HYou are Robot, and your goal is to find Kitten.\033[9;36HThis is complicated by the exsistance of other objects.\033[10;42HYou must touch an object to see what it is.\033[12;39HUse the arrow keys and press any key to continue.");
getch();
system("cls");
printf("\033[2;1H--------------------------------------------------------------------------------------------------------------------------------");
populate();
addkitten();
addrobot();
}
void kitscene() { //kitten cutscene, kitscene - if you will
system("cls");
printf("\033[2;1H--------------------------------------------------------------------------------------------------------------------------------");
for (int i = 0; i < 39; i++) {
printf("\033[28;%dH",(8 + i));//kitten section
for (int j = 0; j < 7; j++) { //kitsceen is 7 characters tall
for (int l = 0; l < 21; l++) { //kitsceen is 19 characters long, including \0 //maybe not anymroe
switch(kitscenetext[j][l]) {
case '`':
printf("\033[33m");
break;
case '.':
printf("\033[32m");
break;
case ',':
printf("\033[0m");
break;
default:
printf("%c", kitscenetext[j][l]);
break;
}
}
printf("\033[18D \033[B");
}
printf("\033[28;%dH",(103 - i));//robot section
for (int j = 0; j < 7; j++) { //kitsceen is 7 characters tall
for (int l = 0; l < 19; l++) { //kitsceen is 19 characters long, including \0
switch(kitscenerobot[j][l]) {
case '`':
printf("\033[90m");
break;
case '.':
printf("\033[31m");
break;
case ',':
printf("\033[0m");
break;
default:
printf("%c", kitscenerobot[j][l]);
break;
}
}
printf("\033[18D\033[B");
}
Sleep(50); //windows only, fix cross-platfrom with defiens
}
printf("\033[1;1H \033[1;1H"); //clear line manually because windwos termina lis crap
printf("\033[1;1HAgain? [y/n]");
sleep(1);
int exitchoice = getch();
while(1) { //the stuff inthe while loop make it so only y and n work, instead of arrow keys and such working too probably not the best wayof doing it but its fine for v1
if(exitchoice == 110) {
printf("\033[1;1H \033[1;1H"); //clear line manually because windwos termina lis crap
printf("\033[1;1HYeah, cause DOS is so much better...");
getch();
exit(0);
} else if(exitchoice == 121) {
initialize();
return;
}
exitchoice = getch();
}
}
void objectcollidetext(int i) {
if (i == 30) { //if the object is kitten
kitscene();
return;
} else {
printf("\033[1;1H \033[1;1H"); //clear line manually because windwos termina lis crap
for(int j = 0; j < 128; j++) {
printf("%c",text[(object_text[i])][j]);
}
return;
}
}
void moverobot(int direction) {
switch(direction) {
case 72 : //up
move_stop = 0; //for all objects including kitten
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1)); //if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((y[31] - 1 == (-1))) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if(((x[31] == x[i]) && ((y[31] - 1) == y[i]))) { //trying to have same coords as an object, or go out of bounds
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
y[31] = y[31] - 1;
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
case 80 : //down //for all objects including kitten
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1)); //if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((y[31] + 1 == 64)) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if((x[31] == x[i]) && ((y[31] + 1) == y[i])) { //trying to have same coords as an object, or go out of bounds
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
y[31] = y[31] + 1;
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
case 75 : //left //for all objects including kitten
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1)); //if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((x[31] - 1 == (-1))) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if(((x[31] - 1) == x[i]) && (y[31] == y[i])) { //trying to have same coords as an object, or go out of bounds
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
x[31] = x[31] - 1;
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
case 77 : //right //for all objects including kitten
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1)); //if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((x[31] + 1 == 128)) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if(((x[31] + 1) == x[i]) && (y[31] == y[i])) { //trying to have same coords as an object, or go out of bounds
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
x[31] = x[31] + 1;
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
int main() {
initialize();
while(1) {
in = getch();
if (in == 0 || in == 0xE0) in = getch(); //dang ol windows makes you call functions and arrows keys twice to get the input
switch(in) { //this switch statement is kinda goofy because it only really calls moverobot() but thats got a switch statement in it right away, but now theres other buttons too so its good now
case 72 : //up
moverobot(in);
break;
case 80 : //down
moverobot(in);
break;
case 75 : //left
moverobot(in);
break;
case 77 : //right
moverobot(in);
break;
case 27 : //quit with prompt //esc
printf("\033[1;1H \033[1;1HQuit? [y/n]");
if(getch() == 121) {
exit(0);
} else {
printf("\033[1;1H "); //clear the quit dialog
break;
}
case 113 : //quit with prompt //q
printf("\033[1;1H \033[1;1HQuit? [y/n]");
if(getch() == 121) {
exit(0);
} else {
printf("\033[1;1H "); //clear the quit dialog
break;
}
default :
printf("\a"); //bell, possibly annoying
}
}
}

Binary file not shown.

BIN
everything else/rfk-final.o Normal file

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,392 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h> //for void hidecursor(), only required on windows
//"kitten printers"
int in = 0;
int objects = 30; //0-29 are objects, 30 is kitten, 31 is robot
int x[31]; int y[31]; //int x[(objects + 2)]; int y[(objects + 2)]; the + 2 makes room for kitten and robot, but these should be excluded from for loops
char object_symbol[31]; //char object_symbol[(objects + 2)];
int object_color[31]; //int object_color[(objects + 2)];
int object_brightness[31]; //int object_brightness[(objects + 2)];
int object_text[29]; //int object_text[(objects + 2)]; //kitten doesnt have text because a cutscene plays and robot doesnt have text cause you cant colide with it
int populate_stop = 1; int addrobot_stop = 1; int addkitten_stop = 1; int move_stop = 1; int text_stop = 1; //stop variables
int texts = 64; char text[64][128] = { //the text for colliding with nkos, might want to minimize this because it will get big
{"Not kitten."},
{"Not a kitten."},
{"A pigeon with a TCP/IP packet taped to it's leg."}, //i like this line too much not to use it
{"Deez."},
{"The Internet, lying in a puddle on the floor."},
{"Your mother's house."},
{"What is it? I don't know."},
{"That one thing. You know what thing I mean."},
{"A magazine full of bullets... it's not the right type of magazine, though."},
{"Someone spilled their drink here!"},
{"Your Advanced Placement Computer Science Principles classroom."},
{"text 11"},
{"This brick wall is missing a brick! Oh, nevermind, it's just been replaced with a Nokia 3310."},
{"A kitten."},
{"A penguin using an operating system you've never seen before."},
{"An open window shining on a computer with an entirely blue screen."}, //objectively bad //16
{"This white apple is hooked up to a mouse, keyboard and monitor... it isn't doing anything."},
{"A pufferfish using an operating system you've never seen before... the pufferfish is puffed up."},
{"A copy of 'The C Programming Language'."},
{"George (the cat)."},
{"An analog clock running on UNIX time."},
{"The table that you always hit your knee on."},
{"A calendar with some classic cars on it for 2022."},
{"Justice, finally!"},
{"A newspaper dated December 6th, 1941... it seems like it was a good day."},
{"Poland."},
{"An old map of Europe... it looks more like pasta than borders."},
{"The RWin key."},
{"It appears to be a... oh, nevermind."},
{"Another robot! Oh, it's just a mirror."},
{"'Kitten's over there', it says."},
{"A large trashcan, filled to the brim with metal chips... you can't move it."}, //32
{"The 32-bit integer limit."},
{"A generic car, endlessly doing donuts."},
{"A bug, causing problems as usual."},
{"#ff00ff"},
{"3 pythons, squirming in place."},
{"A sign says 'Members Only'... you can't tell what the object is."}, //"You must be a member to discover this object."
{"A segme ntation fault."},
{"The goods."},
{"A partridge in a pear tree."},
{"A penguin wearing a tux."},
{"'Mostly sunny'? What, in this void?"},
{"\\033[1;1H"},
{"The metric system."},
{"h."},
{"'Kilroy was here', says Kilroy."},
{"The stack, don't touch it though!"}, //48
{"A TOR node."},
{":)"},
{"The blue cable drive."},
{"You Win! Oh, wait a minute... nevermind."},
{"An external numpad... two keys are worn down."},
{"An X server."},
{"All of your deleted files, in a pile on the ground."},
{"Dexterity."},
{"A bottle of battery acid, essentially poison for robot."},
{"Sweet, some sugar!"},
{"A block of code."},
{"The third dimension."},
{"CDs stacked so high that you can't see the top... they all say something about '500 free hours'."},
{"A computer with glasses and a fake nose... it might be spyware."},
{"This toaster has a few forks sticking out of the top... the toaster is unplugged."},
{"A label firmly stuck to the ground says 'PROPERTY OF THE STATE'."} //64
}; //elegant, i know
char kitscenetext[7][21] = {
{" `/\\_____/\\ "}, //`oragne .green ,reset
{" / .o o` \\ "},
{" ( ,== `^ ,== `) "},
{" ) ( "},
{" / \\ "},
{" / / | | \\ \\ "},
{"/__|__|___|__|__\\,"},
};
char kitscenerobot[7][19] = {
{" `___ "}, //`grey .red ,reset
{" |_.@`_| "},
{" | | "},
{" \\---|---\\ "},
{" | | "},
{" | "},
{" O--O--O, "},
};
time_t t;
void hidecursor() { //i hate windows, and you do too
HANDLE consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO info;
info.dwSize = 100;
info.bVisible = FALSE;
SetConsoleCursorInfo(consoleHandle, &info);
}
void populate() {
for(int i = 0; i < objects; i++) { //initial position randomization
x[i] = (rand() % 128);
y[i] = (rand() % 64);
object_symbol[i] = ((rand() % 93) + 32); //ansi 33-126
if (rand() % 2) { //picks between the top or bottom 8 colors
object_color[i] = ((rand() % 8) + 31); //color 31-38, 30 is excluded because the background is black and the character would be invisible
} else {
object_color[i] = ((rand() % 8) + 90); //color 90-98
}
object_text[i] = ((rand() % texts)); //text 0-127
}
while(populate_stop) { //check if multiple positions are the same, if so then re-randomize those positions
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if((x[i] == x[j]) && (y[i] == y[j])) {
x[i] = (rand() % 128);
y[i] = (rand() % 64);
} else {
populate_stop = 0;
}
}
}
}
while(text_stop) {
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if(object_text[i] == object_text[j]) {
object_text[i] = ((rand() % texts));
} else {
text_stop = 0;
}
}
}
}
object_text[30] = 0; //kitten always gets 2 for some reason so im making it 0 manually for niceness
for (int i = 0; i < objects; i++) {
printf("\033[%d;%dH\033[%dm%c\033[0m",(y[i] + 3),(x[i] + 1),object_color[i],object_symbol[i]);
}
}
void addkitten() {
x[30] = (rand() % 128);
y[30] = (rand() % 64);
object_symbol[30] = ((rand() % 93) + 32); //ansi 33-126
if (rand() % 2) { //picks between the top or bottom 8 colors
object_color[30] = ((rand() % 8) + 31); //color 31-38, 30 is excluded because the background is black and the character would be invisible
} else {
object_color[30] = ((rand() % 8) + 90); //color 90-98
}
while(addkitten_stop) { //check if multiple positions are the same, if so then re-randomize those positions
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if((x[30] == x[j]) && (y[30] == y[j])) {
x[30] = (rand() % 128);
y[30] = (rand() % 64);
} else {
addkitten_stop = 0;
}
}
}
}
//the kitten printer
printf("\033[%d;%dH\033[%dm%c\033[0m",(y[30] + 3),(x[30] + 1),object_color[30],object_symbol[30]);
}
void addrobot() {
x[31] = (rand() % 128);
y[31] = (rand() % 64);
object_symbol[31] = 35; //robot is always a bright white #
object_color[31] = 97;
while(addrobot_stop) {
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if((x[31] == x[j]) && (y[31] == y[j])) {
x[31] = (rand() % 128);
y[31] = (rand() % 64);
} else {
addrobot_stop = 0;
}
}
}
}
printf("\033[%d;%dH\033[%dm%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
}
void initialize() {
hidecursor(); //hides cursor on windows
srand(time(t));
system("mode con: cols=128 lines=66");
printf("\033]0;rfk\x1b\x5c"); //set conlse title to rfk
printf("\033[8;40HYou are Robot, and your goal is to find Kitten.\033[9;36HThis is complicated by the exsistance of other objects.\033[10;42HYou must touch an object to see what it is.\033[12;39HUse the arrow keys and press any key to continue.");
getch();
system("cls");
printf("\033[2;1H--------------------------------------------------------------------------------------------------------------------------------");
populate();
addkitten();
addrobot();
}
void kitscene() { //kitten cutscene, kitscene - if you will
system("cls");
printf("\033[2;1H--------------------------------------------------------------------------------------------------------------------------------");
for (int i = 0; i < 39; i++) {
printf("\033[28;%dH",(8 + i));//kitten section
for (int j = 0; j < 7; j++) { //kitsceen is 7 characters tall
for (int l = 0; l < 21; l++) { //kitsceen is 19 characters long, including \0 //maybe not anymroe
switch(kitscenetext[j][l]) {
case '`':
printf("\033[33m");
break;
case '.':
printf("\033[32m");
break;
case ',':
printf("\033[0m");
break;
default:
printf("%c", kitscenetext[j][l]);
break;
}
}
printf("\033[18D \033[B");
}
printf("\033[28;%dH",(103 - i));//robot section
for (int j = 0; j < 7; j++) { //kitsceen is 7 characters tall
for (int l = 0; l < 19; l++) { //kitsceen is 19 characters long, including \0
switch(kitscenerobot[j][l]) {
case '`':
printf("\033[90m");
break;
case '.':
printf("\033[31m");
break;
case ',':
printf("\033[0m");
break;
default:
printf("%c", kitscenerobot[j][l]);
break;
}
}
printf("\033[18D\033[B");
}
Sleep(50); //windows only, fix cross-platfrom with defiens
}
printf("\033[1;1H \033[1;1H"); //clear line manually because windwos termina lis crap
printf("\033[1;1HAgain? [y/n]");
sleep(1);
int exitchoice = getch();
while(1) { //the stuff inthe while loop make it so only y and n work, instead of arrow keys and such working too probably not the best wayof doing it but its fine for v1
if(exitchoice == 110) {
printf("\033[1;1H \033[1;1H"); //clear line manually because windwos termina lis crap
printf("\033[1;1HYeah, cause DOS is so much better...");
getch();
exit(0);
} else if(exitchoice == 121) {
initialize();
return;
}
exitchoice = getch();
}
}
void objectcollidetext(int i) {
if (i == 30) { //if the object is kitten
kitscene();
return;
} else {
printf("\033[1;1H \033[1;1H"); //clear line manually because windwos termina lis crap
for(int j = 0; j < 128; j++) {
printf("%c",text[(object_text[i])][j]);
}
return;
}
}
void moverobot(int direction) {
switch(direction) {
case 72 : //up
move_stop = 0; //for all objects including kitten
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1)); //if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((y[31] - 1 == (-1))) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if(((x[31] == x[i]) && ((y[31] - 1) == y[i]))) { //trying to have same coords as an object, or go out of bounds
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
y[31] = y[31] - 1;
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
case 80 : //down //for all objects including kitten
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1)); //if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((y[31] + 1 == 64)) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if((x[31] == x[i]) && ((y[31] + 1) == y[i])) { //trying to have same coords as an object, or go out of bounds
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
y[31] = y[31] + 1;
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
case 75 : //left //for all objects including kitten
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1)); //if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((x[31] - 1 == (-1))) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if(((x[31] - 1) == x[i]) && (y[31] == y[i])) { //trying to have same coords as an object, or go out of bounds
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
x[31] = x[31] - 1;
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
case 77 : //right //for all objects including kitten
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1)); //if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((x[31] + 1 == 128)) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if(((x[31] + 1) == x[i]) && (y[31] == y[i])) { //trying to have same coords as an object, or go out of bounds
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
x[31] = x[31] + 1;
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
int main() {
initialize();
while(1) {
in = getch();
if (in == 0 || in == 0xE0) in = getch(); //dang ol windows makes you call functions and arrows keys twice to get the input
switch(in) { //this switch statement is kinda goofy because it only really calls moverobot() but thats got a switch statement in it right away, but now theres other buttons too so its good now
case 72 : //up
moverobot(in);
break;
case 80 : //down
moverobot(in);
break;
case 75 : //left
moverobot(in);
break;
case 77 : //right
moverobot(in);
break;
case 27 : //quit with prompt //esc
printf("\033[1;1H \033[1;1HQuit? [y/n]");
if(getch() == 121) {
exit(0);
} else {
printf("\033[1;1H "); //clear the quit dialog
break;
}
case 113 : //quit with prompt //q
printf("\033[1;1H \033[1;1HQuit? [y/n]");
if(getch() == 121) {
exit(0);
} else {
printf("\033[1;1H "); //clear the quit dialog
break;
}
default :
printf("\a"); //bell, possibly annoying
}
}
}

2
everything else/rfk.bat Normal file
View File

@ -0,0 +1,2 @@
rfk.exe
pause

11
everything else/rfk_pad.c Normal file
View File

@ -0,0 +1,11 @@
#include <stdio.h>
int main() {//prints
char text[64][128] = {
{"fuckin balls"},
};
for (int i = 0; i < 128; i++) {
printf("%c",text[0][i]);
}
getch();
}

BIN
everything else/rfk_pad.exe Normal file

Binary file not shown.

BIN
everything else/rfk_pad.o Normal file

Binary file not shown.

View File

@ -0,0 +1,2 @@
scantest.exe
pause

101
everything else/scantest.c Normal file
View File

@ -0,0 +1,101 @@
#include <stdio.h>
#include <stdlib.h>
//#include <windows.h>
int main() {
int textline = 0;
int textchar = 0;
char text[512][127];
char textstore[512];
int *textp; textp = &textstore;
FILE *texts;
texts = fopen("texts.rfk", "r");
if (texts == NULL) {
exit(1);
} else {
textp = fgets(textp, (512 * 128), texts);
}
for (int i = 0; i < (512 * 128); i++) {
if (textstore[i] == '\0') {
break;
} else {
printf("%c", textstore[i]);
}
}
printf("\n---------------------------------------\n");
/*for (int i = 0; i < (512 * 128); i++) {
if (textstore[i] == '\0') {
break;
} else if (textstore[i] == ';') {
text[textline][textchar] = '\0';
textline++;
textchar = 0;
} else {
text[textline][textchar] = textstore[i];
//textline++;
textchar++;
}
printf("%d %d ", textchar, textline);
}
printf("\n---------------------------------------\n");
for (int i = 0; i < 32; i++) {
for (int j = 0; j < 127; j++) {
printf("%c",text[i][j]);
}
printf("\n");
}
printf("\n---------------------------------------\n");
/*for (int balls = 0; balls < 3; balls++) {
for (int i = 0; i < (512 * 128); i++) {
if (textstore[i] != ';') {
//textstore[i] = '\0';
textstore[i - 1] = textstore[i];
} else {
break;
}
}
}*/
/*//for (int i = 0; i < (512 * 128); i++) {
int deadcount = 0;
for (int j = 0; j < (512 * 128); j++) {
if (deadcount) {
break;
} else {
if (textstore[i] != ';') {
textstore[i] = '\0';
} else {
break;
}
}
}
for (int j = 0; j < 127; j++) {
if (textstore[i] != ';') {
printf("%c",textstore[i]);
} else {
break;
}
}
//}*/
int deadcount = 0;
for (int i = 0; i < (512 * 128); i++) {
if (textstore[i] == ';') {
textstore[i] = '\0';
deadcount = deadcount + 1;
//break;
} else {
textstore[i] = '\0';
}
//printf("%d, %d ",deadcount, i);
if (deadcount == 32) {
for (int j = 0; j < 127; j++) {
if (textstore[j] == ';') {
break;
}
if (textstore[j] != '\0') {
printf("%c",textstore[j]);
}
}
break;
}
}
}

Binary file not shown.

BIN
everything else/scantest.o Normal file

Binary file not shown.

View File

@ -0,0 +1,199 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
//todo:
//add robot
//challenges:
//populate, addrobot, and addkitten could all be put into one function
int in = 0;
int objects = 30; //1-30 are objects, 31 is kitten, 32 is robot
int x[32]; int y[32]; //int x[(objects + 2)]; int y[(objects + 2)]; the + 2 makes room for kitten and robot, but these should be excluded from for loops
char object_symbol[32]; //char object_symbol[(objects + 2)];
int object_color[32]; //int object_color[(objects + 2)];
int object_brightness[32]; //int object_brightness[(objects + 2)];
int populate_stop = 1;
int addrobot_stop = 1;
int addkitten_stop = 1;
time_t t;
//30 objects, kitten, and robot
//\033[%d;%dH move cursor to spot
//\033[%dm color text
void populate() {
for(int i = 0; i < objects; i++) { //initial position randomization
x[i] = (rand() % 128);
y[i] = (rand() % 64);
object_symbol[i] = ((rand() % 93) + 32); //ansi 33-126
object_color[i] = ((rand() % 8) + 29); //ansi escape code color 30-37
object_brightness[i] = (rand() % 2); //brightness for color value
}
while(populate_stop) { //check if multiple positions are the same, if so then re-randomize those positions
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if((x[i] == x[j]) && (y[i] == y[j])) {
x[i] = (rand() % 128);
y[i] = (rand() % 64);
} else {
populate_stop = 0;
}
}
}
}
for (int i = 0; i < objects; i++) { //move cursor to screen position and place object
if (object_brightness) {
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[i] + 3),(x[i] + 1),object_color[i],(object_symbol[i]));
} else {
printf("\033[%d;%dH\033[%dm%c\033[0m",(y[i] + 3),(x[i] + 1),object_color[i],(object_symbol[i]));
}
}
}
void addkitten() {
x[31] = (rand() % 128);
y[31] = (rand() % 64);
object_symbol[31] = ((rand() % 93) + 32); //ansi 33-126
object_color[31] = ((rand() % 8) + 29); //ansi escape code color 30-37
object_brightness[31] = (rand() % 2); //brightness for color value
while(addkitten_stop) {
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if((x[31] == x[j]) && (y[31] == y[j])) {
x[31] = (rand() % 128);
y[31] = (rand() % 64);
} else {
addkitten_stop = 0;
}
}
}
}
if (object_brightness) { //debug these kitten printers have a white background (;47)
printf("\033[%d;%dH\033[%d;47;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
} else {
printf("\033[%d;%dH\033[%d;47m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
}
}
void addrobot() {
x[32] = (rand() % 128);
y[32] = (rand() % 64);
object_symbol[32] = 35; //robot is always a bright white #
object_color[32] = 37;
object_brightness[32] = 1;
while(addrobot_stop) {
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if((x[32] == x[j]) && (y[32] == y[j])) {
x[32] = (rand() % 128);
y[32] = (rand() % 64);
} else {
addrobot_stop = 0;
}
}
}
}
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[32] + 3),(x[32] + 1),object_color[32],(object_symbol[32]));
}
void moverobot(int direction) {
switch(direction) {
case 72 : //up
printf("\033[%d;%dH ",(y[32] + 3),(x[32] + 1)); //clear robot position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((x[32] == x[i]) && ((y[32] - 1) == y[i])) { //trying to have same coords as an object
wprintf("\033[d\033[%d;1m%c\033[0m",object_color[32],object_symbol[32]); //move cursor back one space and then place robot
break;
} else {
wprintf("\033[d\033[a\033[%d;1m%c\033[0m",object_color[32],object_symbol[32]); //move cursor back and up one space and then place robot
break;
}
}
case 80 : //down
printf("\033[%d;%dH ",(y[32] + 3),(x[32] + 1)); //clear robot position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((x[32] == x[i]) && ((y[32] - 1) == y[i])) { //trying to have same coords as an object
wprintf("\033[d\033[%d;1m%c\033[0m",object_color[32],object_symbol[32]); //move cursor back one space and then place robot
break;
} else {
wprintf("\033[d\033[b\033[%d;1m%c\033[0m",object_color[32],object_symbol[32]); //move cursor back and up one space and then place robot
break;
}
}
case 75 : //left
printf("\033[%d;%dH ",(y[32] + 3),(x[32] + 1)); //clear robot position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((x[32] == x[i]) && ((y[32] - 1) == y[i])) { //trying to have same coords as an object
wprintf("\033[d\033[%d;1m%c\033[0m",object_color[32],object_symbol[32]); //move cursor back one space and then place robot
break;
} else {
wprintf("\033[d\033[d\033[%d;1m%c\033[0m",object_color[32],object_symbol[32]); //move cursor back and up one space and then place robot
break;
}
}
case 77 : //right
printf("\033[%d;%dH ",(y[32] + 3),(x[32] + 1)); //clear robot position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((x[32] == x[i]) && ((y[32] - 1) == y[i])) { //trying to have same coords as an object
wprintf("\033[d\033[%d;1m%c\033[0m",object_color[32],object_symbol[32]); //move cursor back one space and then place robot
break;
} else {
wprintf("\033[d\033[c\033[%d;1m%c\033[0m",object_color[32],object_symbol[32]); //move cursor back and up one space and then place robot
break;
}
}
/*printf("\033[%d;%dH ",(y[32] + 3),(x[32] + 1));
//for all objects including kitten
//if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if(((x[32] + 1) == x[i]) && (y[32] == y[i])) { //trying to have same coords as an object
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[32]),(x[32]),object_color[32],(object_symbol[32]));
break;
} else {
x[32] = x[32] + 1;
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[32] + 3),(x[32] + 1),object_color[32],(object_symbol[32]));
break;
}
}*/
}
}
int main() {
{ //initialization
srand(time(t));
system("mode con: cols=128 lines=66");
}
{ //start screen
printf("\033[8;8Hb\033[9;8Hr\033[10;8Hu\033[12;8Hh");
getch();
system("cls");
}
{ //initial population
printf("\033[1;1Hinitialization");
printf("\033[2;1H--------------------------------------------------------------------------------------------------------------------------------");
populate();
addkitten();
addrobot();
}
while(in != 27) {
in = getch();
if (in == 0 || in == 0xE0) in = getch(); //got dang ol windows makes you call functions and arrows keys twice to get the input
switch(in) {
case 72 : //up
moverobot(in);
case 80 : //down
moverobot(in);
case 75 : //left
moverobot(in);
case 77 : //right
moverobot(in);
/*default :
printf("pizdec");*/
}
}
}

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1 @@
Not kitten.;Not a kitten.;A pigeon with a TCP/IP packet taped to it's leg.;Deez.;The Internet, lying in a puddle on the floor.;Your mother's house.;What is it? I don't know.;That one thing. You know what thing I mean.;A magazine full of bullets... it's not the right type of magazine, though.;Someone spilled their drink here!;Your Advanced Placement Computer Science Principles classroom.;text 11;This brick wall is missing a brick! Oh, nevermind, it's just been replaced with a Nokia 3310.;A kitten.;A penguin using an operating system you've never seen before.;An open window shining on a computer with an entirely blue screen.;This white apple is hooked up to a mouse, keyboard and monitor... it isn't doing anything.;A pufferfish using an operating system you've never seen before... the pufferfish is puffed up.;A copy of 'The C Programming Language'.;George (the cat).;An analog clock running on UNIX time.;The table that you always hit your knee on.;A calendar with some classic cars on it for 2022.;Justice, finally!;A newspaper dated December 6th, 1941... it seems like it was a good day.;Poland.;An old map of Europe... it looks more like pasta than borders.;The RWin key.;It appears to be a... oh, nevermind.;Another robot! Oh, it's just a mirror.;'Kitten's over there', it says.;A large trashcan, filled to the brim with metal chips... you can't move it.;The 32-bit integer limit.;A generic car, endlessly doing donuts.;A bug, causing problems as usual.;#ff00ff;3 pythons, squirming in place.;A sign says 'Members Only'... you can't tell what the object is.;A segme ntation fault.;The goods.;A partridge in a pear tree.;A penguin wearing a tux.;'Mostly sunny'? What, in this void?;\033[H;The metric system.;h.;'Kilroy was here', says Kilroy.;The stack, don't touch it though!;A TOR node.;:);The blue cable drive.;You Win! Oh, wait a minute... nevermind.;An external numpad... two keys are worn down.;An X server.;All of your deleted files, in a pile on the ground.;Dexterity.;A bottle of battery acid, essentially poison for robot.;Sweet, some sugar!;A block of code.;The third dimension.;CDs stacked so high that you can't see the top... they all say something about '500 free hours'.;A computer with glasses and a fake nose... it might be spyware.;This toaster has a few forks sticking out of the top... the toaster is unplugged.;A label firmly stuck to the ground says 'PROPERTY OF THE STATE'.

View File

@ -0,0 +1 @@
Not kitten.;Not a kitten.;A pigeon with a TCP/IP packet taped to it's leg.;Deez.;The Internet, lying in a puddle on the floor.;Your mother's house.;What is it? I don't know.;That one thing. You know what thing I mean.;A magazine full of bullets... it's not the right type of magazine, though.;Someone spilled their drink here!;Your Advanced Placement Computer Science Principles classroom.;text 11;This brick wall is missing a brick! Oh, nevermind, it's just been replaced with a Nokia 3310.;A kitten.;A penguin using an operating system you've never seen before.;An open window shining on a computer with an entirely blue screen.;This white apple is hooked up to a mouse, keyboard and monitor... it isn't doing anything.;A pufferfish using an operating system you've never seen before... the pufferfish is puffed up.;A copy of 'The C Programming Language'.;George (the cat).;An analog clock running on UNIX time.;The table that you always hit your knee on.;A calendar with some classic cars on it for 2022.;Justice, finally!;A newspaper dated December 6th, 1941... it seems like it was a good day.;Poland.;An old map of Europe... it looks more like pasta than borders.;The RWin key.;It appears to be a... oh, nevermind.;Another robot! Oh, it's just a mirror.;'Kitten's over there', it says.;A large trashcan, filled to the brim with metal chips... you can't move it.;The 32-bit integer limit.;A generic car, endlessly doing donuts.;A bug, causing problems as usual.;#ff00ff;3 pythons, squirming in place.;A sign says 'Members Only'... you can't tell what the object is.;A segme ntation fault.;The goods.;A partridge in a pear tree.;A penguin wearing a tux.;'Mostly sunny'? What, in this void?;\\033[1;1H;The metric system.;h.;'Kilroy was here', says Kilroy.;The stack, don't touch it though!;A TOR node.;:);The blue cable drive.;You Win! Oh, wait a minute... nevermind.;An external numpad... two keys are worn down.;An X server.;All of your deleted files, in a pile on the ground.;Dexterity.;A bottle of battery acid, essentially poison for robot.;Sweet, some sugar!;A block of code.;The third dimension.;CDs stacked so high that you can't see the top... they all say something about '500 free hours'.;A computer with glasses and a fake nose... it might be spyware.;This toaster has a few forks sticking out of the top... the toaster is unplugged.;A label firmly stuck to the ground says 'PROPERTY OF THE STATE'.

392
rfk/rfk.c Normal file
View File

@ -0,0 +1,392 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h> //for void hidecursor(), only required on windows
//"kitten printers"
int in = 0;
int objects = 30; //0-29 are objects, 30 is kitten, 31 is robot
int x[31]; int y[31]; //int x[(objects + 2)]; int y[(objects + 2)]; the + 2 makes room for kitten and robot, but these should be excluded from for loops
char object_symbol[31]; //char object_symbol[(objects + 2)];
int object_color[31]; //int object_color[(objects + 2)];
int object_brightness[31]; //int object_brightness[(objects + 2)];
int object_text[29]; //int object_text[(objects + 2)]; //kitten doesnt have text because a cutscene plays and robot doesnt have text cause you cant colide with it
int populate_stop = 1; int addrobot_stop = 1; int addkitten_stop = 1; int move_stop = 1; int text_stop = 1; //stop variables
int texts = 64; char text[64][128] = { //the text for colliding with nkos, might want to minimize this because it will get big
{"Not kitten."},
{"Not a kitten."},
{"A pigeon with a TCP/IP packet taped to it's leg."}, //i like this line too much not to use it
{"Deez."},
{"The Internet, lying in a puddle on the floor."},
{"Your mother's house."},
{"What is it? I don't know."},
{"That one thing. You know what thing I mean."},
{"A magazine full of bullets... it's not the right type of magazine, though."},
{"Someone spilled their drink here!"},
{"Your Advanced Placement Computer Science Principles classroom."},
{"text 11"},
{"This brick wall is missing a brick! Oh, nevermind, it's just been replaced with a Nokia 3310."},
{"A kitten."},
{"A penguin using an operating system you've never seen before."},
{"An open window shining on a computer with an entirely blue screen."}, //objectively bad //16
{"This white apple is hooked up to a mouse, keyboard and monitor... it isn't doing anything."},
{"A pufferfish using an operating system you've never seen before... the pufferfish is puffed up."},
{"A copy of 'The C Programming Language'."},
{"George (the cat)."},
{"An analog clock running on UNIX time."},
{"The table that you always hit your knee on."},
{"A calendar with some classic cars on it for 2022."},
{"Justice, finally!"},
{"A newspaper dated December 6th, 1941... it seems like it was a good day."},
{"Poland."},
{"An old map of Europe... it looks more like pasta than borders."},
{"The RWin key."},
{"It appears to be a... oh, nevermind."},
{"Another robot! Oh, it's just a mirror."},
{"'Kitten's over there', it says."},
{"A large trashcan, filled to the brim with metal chips... you can't move it."}, //32
{"The 32-bit integer limit."},
{"A generic car, endlessly doing donuts."},
{"A bug, causing problems as usual."},
{"#ff00ff"},
{"3 pythons, squirming in place."},
{"A sign says 'Members Only'... you can't tell what the object is."}, //"You must be a member to discover this object."
{"A segme ntation fault."},
{"The goods."},
{"A partridge in a pear tree."},
{"A penguin wearing a tux."},
{"'Mostly sunny'? What, in this void?"},
{"\\033[1;1H"},
{"The metric system."},
{"h."},
{"'Kilroy was here', says Kilroy."},
{"The stack, don't touch it though!"}, //48
{"A TOR node."},
{":)"},
{"The blue cable drive."},
{"You Win! Oh, wait a minute... nevermind."},
{"An external numpad... two keys are worn down."},
{"An X server."},
{"All of your deleted files, in a pile on the ground."},
{"Dexterity."},
{"A bottle of battery acid, essentially poison for robot."},
{"Sweet, some sugar!"},
{"A block of code."},
{"The third dimension."},
{"CDs stacked so high that you can't see the top... they all say something about '500 free hours'."},
{"A computer with glasses and a fake nose... it might be spyware."},
{"This toaster has a few forks sticking out of the top... the toaster is unplugged."},
{"A label firmly stuck to the ground says 'PROPERTY OF THE STATE'."} //64
}; //elegant, i know
char kitscenetext[7][21] = {
{" `/\\_____/\\ "}, //`oragne .green ,reset
{" / .o o` \\ "},
{" ( ,== `^ ,== `) "},
{" ) ( "},
{" / \\ "},
{" / / | | \\ \\ "},
{"/__|__|___|__|__\\,"},
};
char kitscenerobot[7][19] = {
{" `___ "}, //`grey .red ,reset
{" |_.@`_| "},
{" | | "},
{" \\---|---\\ "},
{" | | "},
{" | "},
{" O--O--O, "},
};
time_t t;
void hidecursor() { //i hate windows, and you do too
HANDLE consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO info;
info.dwSize = 100;
info.bVisible = FALSE;
SetConsoleCursorInfo(consoleHandle, &info);
}
void populate() {
for(int i = 0; i < objects; i++) { //initial position randomization
x[i] = (rand() % 128);
y[i] = (rand() % 64);
object_symbol[i] = ((rand() % 93) + 32); //ansi 33-126
if (rand() % 2) { //picks between the top or bottom 8 colors
object_color[i] = ((rand() % 8) + 31); //color 31-38, 30 is excluded because the background is black and the character would be invisible
} else {
object_color[i] = ((rand() % 8) + 90); //color 90-98
}
object_text[i] = ((rand() % texts)); //text 0-127
}
while(populate_stop) { //check if multiple positions are the same, if so then re-randomize those positions
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if((x[i] == x[j]) && (y[i] == y[j])) {
x[i] = (rand() % 128);
y[i] = (rand() % 64);
} else {
populate_stop = 0;
}
}
}
}
while(text_stop) {
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if(object_text[i] == object_text[j]) {
object_text[i] = ((rand() % texts));
} else {
text_stop = 0;
}
}
}
}
object_text[30] = 0; //kitten always gets 2 for some reason so im making it 0 manually for niceness
for (int i = 0; i < objects; i++) {
printf("\033[%d;%dH\033[%dm%c\033[0m",(y[i] + 3),(x[i] + 1),object_color[i],object_symbol[i]);
}
}
void addkitten() {
x[30] = (rand() % 128);
y[30] = (rand() % 64);
object_symbol[30] = ((rand() % 93) + 32); //ansi 33-126
if (rand() % 2) { //picks between the top or bottom 8 colors
object_color[30] = ((rand() % 8) + 31); //color 31-38, 30 is excluded because the background is black and the character would be invisible
} else {
object_color[30] = ((rand() % 8) + 90); //color 90-98
}
while(addkitten_stop) { //check if multiple positions are the same, if so then re-randomize those positions
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if((x[30] == x[j]) && (y[30] == y[j])) {
x[30] = (rand() % 128);
y[30] = (rand() % 64);
} else {
addkitten_stop = 0;
}
}
}
}
//the kitten printer
printf("\033[%d;%dH\033[%dm%c\033[0m",(y[30] + 3),(x[30] + 1),object_color[30],object_symbol[30]);
}
void addrobot() {
x[31] = (rand() % 128);
y[31] = (rand() % 64);
object_symbol[31] = 35; //robot is always a bright white #
object_color[31] = 97;
while(addrobot_stop) {
for(int i = 0; i < objects; i++) {
for(int j = 0; j < objects; j++) {
if((x[31] == x[j]) && (y[31] == y[j])) {
x[31] = (rand() % 128);
y[31] = (rand() % 64);
} else {
addrobot_stop = 0;
}
}
}
}
printf("\033[%d;%dH\033[%dm%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
}
void initialize() {
hidecursor(); //hides cursor on windows
srand(time(t));
system("mode con: cols=128 lines=66");
printf("\033]0;rfk\x1b\x5c"); //set conlse title to rfk
printf("\033[8;40HYou are Robot, and your goal is to find Kitten.\033[9;36HThis is complicated by the exsistance of other objects.\033[10;42HYou must touch an object to see what it is.\033[12;39HUse the arrow keys and press any key to continue.");
getch();
system("cls");
printf("\033[2;1H--------------------------------------------------------------------------------------------------------------------------------");
populate();
addkitten();
addrobot();
}
void kitscene() { //kitten cutscene, kitscene - if you will
system("cls");
printf("\033[2;1H--------------------------------------------------------------------------------------------------------------------------------");
for (int i = 0; i < 39; i++) {
printf("\033[28;%dH",(8 + i));//kitten section
for (int j = 0; j < 7; j++) { //kitsceen is 7 characters tall
for (int l = 0; l < 21; l++) { //kitsceen is 19 characters long, including \0 //maybe not anymroe
switch(kitscenetext[j][l]) {
case '`':
printf("\033[33m");
break;
case '.':
printf("\033[32m");
break;
case ',':
printf("\033[0m");
break;
default:
printf("%c", kitscenetext[j][l]);
break;
}
}
printf("\033[18D \033[B");
}
printf("\033[28;%dH",(103 - i));//robot section
for (int j = 0; j < 7; j++) { //kitsceen is 7 characters tall
for (int l = 0; l < 19; l++) { //kitsceen is 19 characters long, including \0
switch(kitscenerobot[j][l]) {
case '`':
printf("\033[90m");
break;
case '.':
printf("\033[31m");
break;
case ',':
printf("\033[0m");
break;
default:
printf("%c", kitscenerobot[j][l]);
break;
}
}
printf("\033[18D\033[B");
}
Sleep(50); //windows only, fix cross-platfrom with defiens
}
printf("\033[1;1H \033[1;1H"); //clear line manually because windwos termina lis crap
printf("\033[1;1HAgain? [y/n]");
sleep(1);
int exitchoice = getch();
while(1) { //the stuff inthe while loop make it so only y and n work, instead of arrow keys and such working too probably not the best wayof doing it but its fine for v1
if(exitchoice == 110) {
printf("\033[1;1H \033[1;1H"); //clear line manually because windwos termina lis crap
printf("\033[1;1HYeah, cause DOS is so much better...");
getch();
exit(0);
} else if(exitchoice == 121) {
initialize();
return;
}
exitchoice = getch();
}
}
void objectcollidetext(int i) {
if (i == 30) { //if the object is kitten
kitscene();
return;
} else {
printf("\033[1;1H \033[1;1H"); //clear line manually because windwos termina lis crap
for(int j = 0; j < 128; j++) {
printf("%c",text[(object_text[i])][j]);
}
return;
}
}
void moverobot(int direction) {
switch(direction) {
case 72 : //up
move_stop = 0; //for all objects including kitten
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1)); //if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((y[31] - 1 == (-1))) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if(((x[31] == x[i]) && ((y[31] - 1) == y[i]))) { //trying to have same coords as an object, or go out of bounds
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
y[31] = y[31] - 1;
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
case 80 : //down //for all objects including kitten
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1)); //if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((y[31] + 1 == 64)) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if((x[31] == x[i]) && ((y[31] + 1) == y[i])) { //trying to have same coords as an object, or go out of bounds
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
y[31] = y[31] + 1;
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
case 75 : //left //for all objects including kitten
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1)); //if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((x[31] - 1 == (-1))) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if(((x[31] - 1) == x[i]) && (y[31] == y[i])) { //trying to have same coords as an object, or go out of bounds
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
x[31] = x[31] - 1;
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
case 77 : //right //for all objects including kitten
printf("\033[%d;%dH ",(y[31] + 3),(x[31] + 1)); //if robot coords + 1 in wahatever direction equal the coords of something else then dont move, otherwise set the coods to that position
for(int i = 0; i < (objects + 1); i++) { //objects + 1 to account for kitten
if((x[31] + 1 == 128)) { //if collided with a wall, dont do the text/kitten check because otherwise it will return the text of object 0
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
} else if(((x[31] + 1) == x[i]) && (y[31] == y[i])) { //trying to have same coords as an object, or go out of bounds
objectcollidetext(i);
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
x[31] = x[31] + 1;
printf("\033[%d;%dH\033[%d;1m%c\033[0m",(y[31] + 3),(x[31] + 1),object_color[31],(object_symbol[31]));
return;
}
}
int main() {
initialize();
while(1) {
in = getch();
if (in == 0 || in == 0xE0) in = getch(); //dang ol windows makes you call functions and arrows keys twice to get the input
switch(in) { //this switch statement is kinda goofy because it only really calls moverobot() but thats got a switch statement in it right away, but now theres other buttons too so its good now
case 72 : //up
moverobot(in);
break;
case 80 : //down
moverobot(in);
break;
case 75 : //left
moverobot(in);
break;
case 77 : //right
moverobot(in);
break;
case 27 : //quit with prompt //esc
printf("\033[1;1H \033[1;1HQuit? [y/n]");
if(getch() == 121) {
exit(0);
} else {
printf("\033[1;1H "); //clear the quit dialog
break;
}
case 113 : //quit with prompt //q
printf("\033[1;1H \033[1;1HQuit? [y/n]");
if(getch() == 121) {
exit(0);
} else {
printf("\033[1;1H "); //clear the quit dialog
break;
}
default :
printf("\a"); //bell, possibly annoying
}
}
}

BIN
rfk/rfk.exe Normal file

Binary file not shown.

BIN
rfk/rfk.o Normal file

Binary file not shown.