Skip to content

arjunsatarkar/8hash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

8hash

A consistent "magic 8-ball" that chooses the result based on a hash of the input string, so that it always returns the same result when given the same input (or fails to return a concrete answer).

Since the standard non-committal answers in a magic 8-ball indicate that you should try again later, we first randomly decide if we should use a non-committal answer or not, and only if not, use the hash of the input to pick an unchanging committal answer.

Rationale

It is somewhat strange that magic 8-balls, both physical and digital, can return opposite responses to the same question. At least in the digital case, we can mitigate this.

Of course, if you get an answer not to your liking, you can reword your query to try for a new one.

About

Consistent magic 8-ball: choose the answer based on a hash of the input string

Topics

Resources

Stars

Watchers

Forks