Search found 59 matches

by whuyse
Tue Jun 23, 2020 9:48 am
Forum: Software Library
Topic: XLanding Game
Replies: 3
Views: 348

Re: XLanding Game

It is indeed hard ;-)
2 suggestions:
- erase the UFO before redrawing it (when you haven't clicked a button)
- use LSTO statements, then you don't have to clean up the variables. Works with REGS, too.

Cheers, Werner
by whuyse
Fri Jun 05, 2020 8:47 am
Forum: Usage tips, tricks and problem reports
Topic: AGRAPH and Menus
Replies: 1
Views: 260

Re: AGRAPH and Menus

Moderator note: program surrounded by 'code' tags for compactness. Yes, but it is a bit involved: use GETKEY to catch the menu keys. A few things to know: - you want GETKEY to catch only the keys you want, and do nothing on others. The simplest way is putting all key codes in ALPHA and using POSA to...
by whuyse
Wed May 13, 2020 12:43 pm
Forum: Software Library
Topic: Perfect functions
Replies: 0
Views: 469

Perfect functions

A 'perfect' function is one that mimicks the built-in functions: save X in LastX take the n arguments from the stack, compute the result in X roll down the stack and replicate reg T n-1 times These small routines will alow you to turn any of your programs into 'perfect functions'. Call XEQ "PF1", "P...
by whuyse
Mon Apr 27, 2020 9:10 am
Forum: DM1x/DM1xL
Topic: [DM16] Least Common Multipple (LCM)) on stack
Replies: 2
Views: 790

Re: [DM16] Least Common Multipple (LCM)) on stack

It is better to calculate the LCM(a,b) as (b/GCD(a,b))*a, that way you won't lose digits if the product a*b exceeds 1e12, so

Code: Select all

LBL C
GSB D
GSB E
/
*
RTN
Cheers, Werner
by whuyse
Mon Apr 27, 2020 8:34 am
Forum: DM1x/DM1xL
Topic: [DM16] Euclidean algorithm in stack
Replies: 2
Views: 1486

Re: [DM16] Euclidean algorithm in stack

You can do it with just LBL E:

Code: Select all

LBL E
RMD
LASTX
X<>Y
X!=0?
GTO E
+
RTN
Cheers, Werner
by whuyse
Mon Apr 27, 2020 8:11 am
Forum: DM1x/DM1xL
Topic: [DM16] Duplicating stack x and y into z and t
Replies: 2
Views: 883

Re: [DM16] Duplicating stack x and y into z and t

I have never seen a 16C, but restricting myself to ABS, ENTER, RDN and X<>Y, I come up with

Code: Select all

ABS
RDN
ENTER
ENTER
LASTX
X<>Y
LASTX
Or, a version that keeps L intact, and uses RUP (edited to remove a superfluous ENTER!)

Code: Select all

ENTER
ENTER
RUP
ENTER
RDN
X<>Y
Cheers, Werner
by whuyse
Mon Mar 30, 2020 9:38 am
Forum: Usage tips, tricks and problem reports
Topic: Peculiar Behaviour of solver on DM42
Replies: 4
Views: 901

Re: Peculiar Behaviour of solver on DM42

The program is correct, Walter.
But I can't reproduce it - we have to know the guess(es) introduced for X?
Also, what's the version of the DM42? (SETUP-About)
Cheers, Werner
by whuyse
Wed Mar 18, 2020 2:23 pm
Forum: Software Library
Topic: Decimal to fraction conversion
Replies: 3
Views: 2449

Re: Decimal to fraction conversion

Joe: because it checks whether the error is less than 1e-12.
1146408/364913 - 3.14159265359 = 1.4e-12

Cheers, Werner
by whuyse
Sat Feb 29, 2020 8:03 am
Forum: Software Library
Topic: Matrix Viewer
Replies: 20
Views: 5862

Re: Matrix Viewer

I’m having second thoughts on the top vs bottom-aligned fonts. 2. I'm not sure about having the UFL matrix "top aligned". By it being Bottom Aligned, it makes doing upper/lower case words simple - likewise doing subscripts/superscripts. Upper/lower case is no issue of course, that’s not what I meant...
by whuyse
Fri Feb 28, 2020 9:24 pm
Forum: Software Library
Topic: Matrix Viewer
Replies: 20
Views: 5862

Re: Matrix Viewer

2. I'm not sure about having the UFL matrix "top aligned". By it being Bottom Aligned, it makes doing upper/lower case words simple - likewise doing subscripts/superscripts. 3. I think it would be best to have the UFL matrix bottom aligned and then just use your DF program to adjust for a top align...