Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Prog Challenge

Name: Anonymous 2022-10-26 12:36

We all know the classic magic numbers, like 0xcafebabe and 0xdeadba11

But are there more? Write a routine which given an english dictionary finds all words re-presentable in hex that way.

Challenge: make it O(n)

Name: Anonymous 2022-10-29 14:49

(defun hex-char-p (char)
(member char '(#\a #\b #\c #\d #\e #\f #\l #\t #\s)))

(defun hex-word-p (word)
(if (zerop (count-if-not #'hex-char-p word))
word
nil))

(defun find-all-hex-words (words)
(remove-if #'null (mapcar #'hex-word-p words)))


Sorry, I don't know how to make it efficient without making it ugly.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List