Initial work
This commit is contained in:
8
CS1032/practical-2023-09-27/challenges-5.janet
Normal file
8
CS1032/practical-2023-09-27/challenges-5.janet
Normal file
@@ -0,0 +1,8 @@
|
||||
(def old (peg/compile ~(* (repeat 3 (range "AZ")) " " (repeat 3 (range "09")) -1)))
|
||||
(def new (peg/compile ~(* (repeat 4 (range "09")) " " (repeat 3 (range "AZ")) -1)))
|
||||
|
||||
(defn main [_ arg] (print (cond
|
||||
(peg/match old arg) "Old"
|
||||
(peg/match new arg) "New"
|
||||
true "Not a license plate"
|
||||
)))
|
||||
Reference in New Issue
Block a user