<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Convert Python to Lisp in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-python-to-lisp/m-p/11234496#M44347</link>
    <description>&lt;P&gt;This worked! It considers 0 as a possible answer as well though. Thanks a lot for your help and I realized there will be a long journey until I get hold of this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 14 Jun 2022 15:33:00 GMT</pubDate>
    <dc:creator>phmzanatta93</dc:creator>
    <dc:date>2022-06-14T15:33:00Z</dc:date>
    <item>
      <title>Convert Python to Lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-python-to-lisp/m-p/11234418#M44344</link>
      <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently on the process of learning Lisp coding. I am trying to do an exercise and it is basically this python code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;import&lt;/SPAN&gt;&lt;SPAN&gt; random target_num&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;SPAN&gt; guess_num &lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; random&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;randint&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;1&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;10&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;0&lt;/SPAN&gt; &lt;SPAN class=""&gt;while&lt;/SPAN&gt;&lt;SPAN&gt; target_num &lt;/SPAN&gt;&lt;SPAN class=""&gt;!=&lt;/SPAN&gt;&lt;SPAN&gt; guess_num&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN&gt; guess_num &lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;int&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;input&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;'Guess a number between 1 and 10 until you get it right : '&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt; &lt;SPAN class=""&gt;print&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;'Well guessed!'&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I write thin in Lisp to run it on AutoCAD?&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 15:09:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-python-to-lisp/m-p/11234418#M44344</guid>
      <dc:creator>phmzanatta93</dc:creator>
      <dc:date>2022-06-14T15:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Python to Lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-python-to-lisp/m-p/11234445#M44345</link>
      <description>&lt;P&gt;There is no such function as "random" in lisp. Has to be a custom func - as&amp;nbsp;&lt;A href="http://www.lee-mac.com/random.html" target="_blank" rel="noopener"&gt;THIS&lt;/A&gt;&amp;nbsp; example.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 15:18:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-python-to-lisp/m-p/11234445#M44345</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2022-06-14T15:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Python to Lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-python-to-lisp/m-p/11234473#M44346</link>
      <description>&lt;P&gt;Heres your one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;
(defun c:GuessNumber ( / LM:rand LM:randrange taget_number guess_num)
  
  ;; Rand  -  Lee Mac
  ;; PRNG implementing a linear congruential generator with
  ;; parameters derived from the book 'Numerical Recipes'
  
  (defun LM:rand ( / a c m )
    (setq m   4294967296.0
	  a   1664525.0
	  c   1013904223.0
	  $xn (rem (+ c (* a (cond ($xn) ((getvar 'date))))) m)
	  )
    (/ $xn m))
  
  (defun LM:randrange ( a b )
    (+ (min a b) (fix (* (LM:rand) (1+ (abs (- a b)))))))
  
  ; ----------------------------------
    
  (setq taget_number (LM:randrange 1 10))
  
  (while (/= taget_number guess_num)
    (setq guess_num (getint "\nGuess a number between 1 and 10 until you get it right: ")))
  
  (princ "\nFinally! Now you're right.")
  (princ)
  )
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 15:27:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-python-to-lisp/m-p/11234473#M44346</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2022-06-14T15:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Python to Lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-python-to-lisp/m-p/11234496#M44347</link>
      <description>&lt;P&gt;This worked! It considers 0 as a possible answer as well though. Thanks a lot for your help and I realized there will be a long journey until I get hold of this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 15:33:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-python-to-lisp/m-p/11234496#M44347</guid>
      <dc:creator>phmzanatta93</dc:creator>
      <dc:date>2022-06-14T15:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Python to Lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-python-to-lisp/m-p/11234518#M44348</link>
      <description>&lt;P&gt;I don't know python much. So if that code restricts a user input to a range 1-10, that is what lisp can't. has to be done manually. Just&amp;nbsp;&lt;A href="https://help.autodesk.com/view/ACD/2022/ENU/?guid=GUID-9ED8841B-5C1D-4B3F-9F3B-84A4408A6BBF" target="_blank" rel="noopener"&gt;THIS&lt;/A&gt;&amp;nbsp;is possible.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 15:43:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/convert-python-to-lisp/m-p/11234518#M44348</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2022-06-14T15:43:47Z</dc:date>
    </item>
  </channel>
</rss>

