Pangram checker: Difference between revisions

Line 1,490:
=={{header|NewLISP}}==
<lang newlisp>
(context 'PGR) ;; Switch to context (namespace) PGR
(define (is-pangram? str)
(setf chars (explode (upper-case str))) ;; Uppercase + convert string into a list of chars
(setf is-pangram-status true) ;; Default value
(for (c (char "A") (char "Z") 1 (nil? is-pangram-status)) ;; For loop with break condition
(if (not (find (char c) chars)) ;; If char not found in list, "is-pangram-status" become "nil"
(setf is-pangram-status nil)
)
)
is-pangram-status ;; Return current value if symbol "is-pangram-status"
)
(context 'MAIN)
Line 1,505:
;; - - - - - - - - - -
 
(println (PGR:is-pangram? "abcdefghijklmnopqrstuvwxyz")) ;; ReturnPrint true
(println (PGR:is-pangram? "abcdef")) ;; ReturnPrint nil
(exit)
</lang>
62

edits