- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
(ql:quickload :cl-json)
(defmacro penetrate-json (val shifrate)
`(if (null ,shifrate)
,val)
`(case ,shifrate
(#XA (penetrate-json (car ,val) (cadr ,shifrate)))
(#XF (penetrate-json (cdr ,val) (cadr ,shifrate)))
(#XFF (penetrate-json (caadar ,val) (cadr ,shifrate)))
(#XFA (penetrate-json (cddddr ,val) (cadr ,shifrate)))
(#XAF (penetrate-json (caddar ,val) (cadr ,shifrate)))
(#XFFF (penetrate-json (cdaadr ,val) (cadr ,shifrate)))
(#XFAF (penetrate-json (cddadr ,val) (cadr ,shifrate)))
(#XAAA (penetrate-json (caaddr ,val) (cadr ,shifrate)))))
(let ((parsed (with-open-file (stream "C:/Users/lisps/PycharmProjects/pythonProject/.venv/Scripts/commonlisp/test" :direction :input)
(json:decode-json-from-source stream))))
(setf (cdadar (penetrate-json (assoc :pidorasik parsed) `(,#XA ,#XFAF ,#XFFF ,#XAF ,#XF ,#XAAA ,#XFAF ,#XFF))) 100) ; oh my fucking gosh
(with-open-file (stream "C:/Users/lisps/PycharmProjects/pythonProject/.venv/Scripts/commonlisp/test" :direction :output :if-exists :supersede)
(json:encode-json parsed stream)))