{"id":30,"date":"2021-02-18T12:00:00","date_gmt":"2021-02-18T12:00:00","guid":{"rendered":"https:\/\/eric.tedjamulia.com\/blog\/ruin-a-book-title\/"},"modified":"2021-02-18T12:00:00","modified_gmt":"2021-02-18T12:00:00","slug":"ruin-a-book-title","status":"publish","type":"post","link":"https:\/\/eric.tedjamulia.com\/blog\/ruin-a-book-title\/","title":{"rendered":"Change one letter, ruin a book"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Somebody posted the challenge to change one letter in a book title and ruin it. Naturally, I decided the computer should help come up with the bad suggestions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The page has an embedded dictionary and a small JavaScript search. For each word in the title, it tries replacing one character at a time with another letter. If the result is in the dictionary, it prints a new version of the title and colors the changed word red. The title and the dictionary stay in the browser; there is no request to a service for suggestions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It does not understand books or jokes. It just finds possible word substitutions, and we get to decide which ones are funny. I like the gap between a very mechanical search and the occasional ridiculous result. This was probably more code than the original challenge required, but that is half the fun.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/etedj.com\/projects\/fun\/BookTitleChange.html\">Try a book title<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Somebody posted the challenge to change one letter in a book title and ruin it. Naturally, I decided the computer should help come up with the bad suggestions. The page has an embedded dictionary and a small JavaScript search. For each word in the title, it tries replacing one character at a time with another [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":31,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[3,27],"class_list":["post-30","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tools","tag-javascript","tag-word-games"],"_links":{"self":[{"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/posts\/30","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/comments?post=30"}],"version-history":[{"count":0,"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/posts\/30\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/media\/31"}],"wp:attachment":[{"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/media?parent=30"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/categories?post=30"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eric.tedjamulia.com\/blog\/wp-json\/wp\/v2\/tags?post=30"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}