Skip to content

Instantly share code, notes, and snippets.

@notarikon-nz
Created August 27, 2024 06:49
Show Gist options
  • Select an option

  • Save notarikon-nz/e1612860ba59d81f8bee631a0f5d7e41 to your computer and use it in GitHub Desktop.

Select an option

Save notarikon-nz/e1612860ba59d81f8bee631a0f5d7e41 to your computer and use it in GitHub Desktop.
HackMUD Data Check Solver
function(context, args)
{
if (!args || !args.lookup)
return `\n\n\`HAPERTURE.SCIENCE :: DATA CHECK LORE\`\n\n` +
"Please provide a question via `1lore { lookup:\"\" }`"
const lookup = args.lookup.toString()
const dc = new Map([
[ 'kn','fran_lee' ],
[ 'eh','robovac' ],
[ ' j','sentience' ],
[ 'ssu','sans_comedy' ],
[ "ie'",'angels' ],
[ 'f m','minions' ],
[ 'u d','sisters' ],
[ 'u e','petra' ],
[ 'u v','fountain' ],
[ 'ui','helpdesk' ],
[ 'gu','bunnybat' ],
[ 'af','get_level' ],
[ 'rv','weathernet' ],
[ 'fac','eve' ],
[ 'iz','resource' ],
[ 'N p','bo' ],
[ "'o",'heard' ],
[ 'n v','teach' ],
[ 'gc','outta_juice' ],
[ 'CA','poetry' ],
[ 'nj','blazer' ],
[ 'n-','dead' ],
[ 'xp','engaged' ],
[ 'rb','a2231' ],
[ 'bs','obsessive' ],
[ 'iu','atlanta' ],
[ 'ata','skimmerite' ],
[ 'dr','goodfellow' ],
[ 'm_','piano' ],
[ '_+','idp1p1' ],
[ 'dk','well' ],
[ 'b ','nubloopstone' ],
[ "b'",'sheriff' ],
[ 'f w','nowhere' ],
[ 'dd','executives' ],
[ 'ak','crowsnest' ],
[ "'r",'thirteen' ],
[ 'm.','diagalpha' ],
[ 'av','bnnyhunter' ],
[ 'e_','unvarnishedpygmyumbrella' ],
[ 'HO','heuristic' ],
[ 'bet','making' ],
[ 'che,','teacher' ],
[ 'rr','kyanite' ],
[ 'eve,','monitor' ],
[ 'kb','lime' ],
[ 'ra ','irreducible' ],
[ 'a,','prover' ],
[ 'k f','disarray' ],
[ '+ s','mark' ],
[ 'yc','choice' ],
[ 'c v','data' ],
[ 'et ','110562' ],
[ 't fu','index' ],
[ 't w','moonstone' ],
[ 'ana','fbreton' ],
[ '+ ov','mhollister' ],
[ 'i i','ai' ],
[ 'i s','binmat' ],
[ 'e h','starchart' ],
[ '+ h','mallory,killed' ],
[ ' or','singapore' ],
[ 'e Co','committee' ],
[ 'pi','hyperion' ],
[ 'M ','meme' ],
[ 'MO','municipal,operating system' ],
[ 'ua','cycle' ],
[ 'dl','value,axiom' ],
[ 'ie,','cityplanner' ],
[ 'the,','translator' ],
[ 'xa','unauthorized,composite operators' ],
[ 'st +','victim,bo' ],
[ 'lt','warden' ],
[ 'za','ethicist' ],
[ 'r w','hardcopies' ],
[ '+-','pattern,sentience' ],
[ 'abl','data,accuracy,threshold' ],
[ 'rne','smirza,identity' ],
[ ' G','imiyawaki,soundtrack' ],
[ "+'",'imiyawaki,infospace' ],
[ 'au','petra,lied' ],
[ ' CO','Committee,???,???,???' ], // ComCODE is formed of an initialism and an acronym, where CODE stands for ++++++ ++++++ ++++++ ++++++
[ 'al +','stage,isolation' ],
[ 'lus','???,???' ], // [angie,chela,mallory,petra,walter,eve,trust,risk,faythe,bigbot]
[ '+!','???,???' ], // there is ++++++ in the ++++++!
[ '+ f','???,???,???,???' ], // user ++++++ fought to spare ++++++, the ++++++ ++++++ [erajbhandari,sg43n87865,fbreton,mhollister]
[ ' D','imiyawaki,bunnybut' ]
]);
let answer = findPartialMatch(dc,lookup)
return { ok:(answer!=null), answer };
function findPartialMatch(map, query) {
for (let [key, value] of map) {
if (query.includes(key)) {
return value.includes(",") ? value.split(",") : value;
}
}
return null; // Return null if no match is found
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment