Search found 183 matches

by cameyo
Mon May 30, 2022 5:55 pm
Forum: newLISP in the real world
Topic: List of indexes
Replies: 5
Views: 3427

Re: List of indexes

Faster solution:

Code: Select all

(setq a '(1 (2 (3 4)) (5 6)))
;Indexes
(ref-all nil a (fn (x) true))
((0) (1) (1 0) (1 1) (1 1 0) (1 1 1) (2) (2 0) (2 1))
;Elements
(ref-all nil a (fn (x) true) true)
(1 (2 (3 4)) 2 (3 4) 3 4 (5 6) 5 6)
by cameyo
Sat May 07, 2022 6:31 pm
Forum: So, what can you actually DO with newLISP?
Topic: Decrypt message
Replies: 2
Views: 1452

Re: Decrypt message

Solution:
"THIS IS MY NEWLISP SCRIPT THAT EMULATES THE ENIGMA MACHINE FROM WWII."
Code:
https://github.com/cameyo42/newLISP-Not ... .lsp#L4699
by cameyo
Tue May 03, 2022 1:16 pm
Forum: So, what can you actually DO with newLISP?
Topic: Decrypt message
Replies: 2
Views: 1452

Re: Decrypt message

Hint: Enigma machine
by cameyo
Sun May 01, 2022 10:51 am
Forum: So, what can you actually DO with newLISP?
Topic: Decrypt message
Replies: 2
Views: 1452

Decrypt message

Decrypt this message:
"WQGI XH BJ HKOUHVO MWCAAP EEQG JDRPJMVH XQZ KSWSJJ STHSKGL XXLU TOXF."
by cameyo
Fri Apr 22, 2022 10:36 am
Forum: Anything else we might add?
Topic: Forum is broken
Replies: 0
Views: 1600

Forum is broken

I can't post code on this forum.
I hope someone can solve the problem.
Thanks
by cameyo
Thu Apr 07, 2022 7:35 pm
Forum: newLISP in the real world
Topic: Editing the lists in the hash-maps
Replies: 0
Views: 1735

Editing the lists in the hash-maps

Example:

Code: Select all

(new Tree 'hh)
(for (i 1 5)
  (setq key (string i))
  (for (k i 1 -1)
    (hh key (if DOLLAR-it (extend (list k) DOLLAR-it)  (list k)))
  )
)
(hh)

Code: Select all

output: (("1" (1)) ("2" (1 2)) ("3" (1 2 3)) ("4" (1 2 3 4)) ("5" (1 2 3 4 5)))
Note: DOLLAR-it is $it
by cameyo
Tue Mar 29, 2022 9:45 am
Forum: So, what can you actually DO with newLISP?
Topic: Cryptarithmetic
Replies: 4
Views: 1791

Re: Cryptarithmetic

Hi Ralph, i have two functions to solve puzzle like this: one uses brute-force and the other uses "amb" :-))
https://github.com/cameyo42/newLISP-Not ... .lsp#L9296
by cameyo
Mon Mar 28, 2022 2:06 pm
Forum: So, what can you actually DO with newLISP?
Topic: Cryptarithmetic
Replies: 4
Views: 1791

Re: Cryptarithmetic

Code: Select all

((("e" 9) ("f" 7) ("i" 6) ("l" 2) ("n" 1) ("p" 0) ("s" 4) ("u" 5) ("w" 8))
 (("e" 8) ("f" 2) ("i" 3) ("l" 7) ("n" 1) ("p" 0) ("s" 6) ("u" 5) ("w" 4))
 (("e" 9) ("f" 2) ("i" 8) ("l" 7) ("n" 1) ("p" 0) ("s" 4) ("u" 5) ("w" 6)))
by cameyo
Sat Mar 19, 2022 7:22 pm
Forum: So, what can you actually DO with newLISP?
Topic: Cryptarithmetic
Replies: 4
Views: 1791

Cryptarithmetic

Solve this (each letter represent a different digit):

Code: Select all

   LISP *
    FUN =
---------
NEWLISP
There are three solution.
p.s. obviously you have to use newlisp :-)
by cameyo
Mon Mar 07, 2022 8:49 pm
Forum: So, what can you actually DO with newLISP?
Topic: ImageMagick
Replies: 0
Views: 1828

ImageMagick

With ImageMagick is possible to create an image from within newLISP. ImageMagick : https://imagemagick.org/ The following command of ImageMagick creates an image "image.png" from a text file "pixels.txt": convert pixels.txt image.png The following command of ImageMagick creates an image "image.png" ...
by cameyo
Fri Feb 18, 2022 7:35 pm
Forum: Anything else we might add?
Topic: forum problems?
Replies: 7
Views: 3305

Re: forum problems?

Hope someone will fix this problem...
by cameyo
Fri Jan 14, 2022 2:47 pm
Forum: newLISP in the real world
Topic: Create a function with a function
Replies: 9
Views: 5370

Re: Create a function with a function

Thanks pda
by cameyo
Fri Jan 14, 2022 2:44 pm
Forum: newLISP in the real world
Topic: Hash-map e contexts
Replies: 5
Views: 2669

Re: Hash-map e contexts

This works for me:

Code: Select all

(define (hash? hash)
  (and (context? (evals hash))
       (not (list? (evals (sym (term hash) hash nil))))))
With "eval" instead of "evals" (to avoid "Internal server error")
by cameyo
Wed Dec 29, 2021 4:24 pm
Forum: newLISP newS
Topic: Error in 10.7.6
Replies: 12
Views: 5099

Re: Error in 10.7.6

Code: Select all

> (push x x)
(?)
> (x 0 0)
ERR: list reference changed
x
Boom
by cameyo
Wed Dec 29, 2021 12:42 pm
Forum: So, what can you actually DO with newLISP?
Topic: Happy New Year
Replies: 0
Views: 2233

Happy New Year

(println "Happy New Year " (- 1 (- 2 (- 3 (* 4 (- 5 (+ 6 (* 7 8 9))))))))
by cameyo
Wed Dec 29, 2021 12:40 pm
Forum: newLISP newS
Topic: Error in 10.7.6
Replies: 12
Views: 5099

Re: Error in 10.7.6

newlisp 10.7.5. windows 10
(push x x)
(?)
(push x x)
((?) ?)
(first x)
(?)
by cameyo
Thu Dec 16, 2021 5:50 pm
Forum: newLISP newS
Topic: Happy Birthday newLisp
Replies: 5
Views: 3453

Re: Happy Birthday newLisp

Congratulations!
by cameyo
Tue Nov 16, 2021 6:18 pm
Forum: So, what can you actually DO with newLISP?
Topic: Library for recreational mathematics
Replies: 0
Views: 2374

Library for recreational mathematics

A library (181 functions) for recreational mathematics: yo.zip
https://github.com/cameyo42/newLISP-Note
by cameyo
Fri Nov 05, 2021 2:42 pm
Forum: newLISP newS
Topic: newLISP_in_21_minutes.html, part 2
Replies: 1
Views: 2082

Re: newLISP_in_21_minutes.html, part 2

Hi Yussi,
the server forum has some problems to render code and some other chars.
I hope someone fix this.
Thanks for your work
by cameyo
Sat Sep 18, 2021 10:14 am
Forum: newLISP in the real world
Topic: Hash-map e contexts
Replies: 5
Views: 2669

Re: Hash-map e contexts

More difficulties:
a context with functor and functions can be a hash-map too.
by cameyo
Fri Sep 10, 2021 8:57 pm
Forum: newLISP in the real world
Topic: Hash-map e contexts
Replies: 5
Views: 2669

Re: Hash-map e contexts

Thank you. I'll do some tests.
by cameyo
Thu Sep 09, 2021 3:16 pm
Forum: newLISP in the real world
Topic: Hash-map e contexts
Replies: 5
Views: 2669

Hash-map e contexts

How to filter only the contexts that represent a hash-map? Example: (dolist (_el (symbols)) (if (context? (eval _el)) (println (eval _el) {} (length (eval _el))))) ; -> Class 2 ; -> MAIN 0 ; -> Tree 0 ; -> demo 0 ; -> myHash 0 (dolist (_el (symbols)) (if (and (context? (eval _el)) (not (= _el 'MAIN)...
by cameyo
Thu Aug 19, 2021 3:33 pm
Forum: newLISP in the real world
Topic: "Code patterns" translation
Replies: 1
Views: 1736

"Code patterns" translation

Italian translation of "Code Patterns in newLISP":
https://github.com/cameyo42/newLISP-Note
cameyo
by cameyo
Fri May 28, 2021 7:41 pm
Forum: newLISP in the real world
Topic: sort list of points
Replies: 1
Views: 2222

Re: sort list of points

Solution found.
(define (cmp x y) (if (= (first x) (first y)) (g.t. (last x) (last y)) (l.t. (first x) (first y))))

Fortran operator g.t. and l.t. don't raise Internal Server Error
by cameyo
Fri May 28, 2021 6:33 pm
Forum: newLISP in the real world
Topic: sort list of points
Replies: 1
Views: 2222

sort list of points

How to sort a list of points (x y) with x ascending and y descending?
I have tried this, but don't work:
(define (comp x y) (and (>= (last x) (last y)) (<= (first x) (first y))))
I can't post all the code... Internal Server Error.