User Tools

Site Tools


Sidebar

Home



Knowledge Base


Guides & Tutorials

Projects

Samples

  G-Code
   Square
   Arcs
   Mickey
   Arrow
   Bear
   Ball In Cage

  Dialogs
   Rounded Square
   Guess The Number

  O-Words
   Polygon

  Subprocedures
   Lissajous

   Lissajous (sub..endsub..call)
   Lissajous (call..sub..endsub)

   Lissajous (exec..O..M99)

   Lissajous (G65)
   Lissajous (G65 with GOTO)

   Palindrome
   PrimeFactors
   Fibonacci

  Splines
   Butterfly

  G06
   G06 H1
   arrchr

  Dynamic
   Clock
   DateTime

  Notepad++ Plugin
   Examples

  3D Models
   small_cnc.txt
   3dModel_TableA.txt


kb:samples:palindrome

Palindrome

#<n> = 123456787654321
O<Palindrome> call [#<n>] [0]
O<if> if [#<n> EQ #<_return>]
	(print,YES)
O<if> else
	(print,NO)
O<if> endif
M2

O<Palindrome> sub
	#<n> = ROUND[#1]
	#<temp> = ROUND[#2]

	O<if> if [#<n> EQ 0]
		O<Palindrome> return [#<temp>]
	O<if> endif

	(print,#1     #2)
	#<temp> = [[#<temp> * 10] + [#<n> MOD 10]]
	O<Palindrome> call [#<n> DIV 10] [#<temp>]
	#<temp> = #<_return>
O<Palindrome> endsub [#<temp>] 
kb/samples/palindrome.txt · Last modified: 2024/04/07 22:40 by andrej

Page Tools