5 Cent tip for today [ Seek Neighbors ]

Featuring the Dragonfly web framework
Locked
newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

5 Cent tip for today [ Seek Neighbors ]

Post by newdep »

#!/usr/bin/newlisp
;;
;; ...seek neighbors in last net range...
;;
;; Usage:
;; ./neighbor.lsp "www.microsoft.com"
;;
;; Seek and Enjoy, Norman.
;;

(reverse (set 'self (net-lookup (nth 2 (main-args)))))
(set 'self (reverse (slice self (find "." self ) (length self))))

(set 'door 0)
(while (< (inc 'door 1) 255)
(println "Neighbor: " (append self (string door)) " -> " (net-lookup (set 'neighbor (append self (string door))))))
-- (define? (Cornflakes))

Locked