Skip to content

Instantly share code, notes, and snippets.

@a13ks3y
Last active June 5, 2023 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a13ks3y/b4b5cff20df66481973c06518fd88a7c to your computer and use it in GitHub Desktop.
Save a13ks3y/b4b5cff20df66481973c06518fd88a7c to your computer and use it in GitHub Desktop.
let memory = {};
try { memory = JSON.parse(localStorage.getItem('memory')) || {}; } catch (e) { console.error(e); }
do {
let query = prompt(`Hi I'm an artificial IDIOT, how can I help you?`);
if (!memory[query]) {
memory[query] = prompt(`I'm suh an IDIOT, I don't know how to respond, please tell me.`);
alert(`Thanks, from now on I will respond: "${memory[query]}" each time you asking "${query}"`);
} else {
alert(memory[query]);
}
try { localStorage.setItem('memory', JSON.stringify(memory)); } catch (e) { console.error(e); }
} while (true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment