Post Reply 
[41/42/..] Micro-challenge: order X and Y by magnitude
03-08-2016, 01:53 PM
Post: #1
[41/42/..] Micro-challenge: order X and Y by magnitude
Really very small challenge. Given two numbers in X and Y, order them so that the smallest in magnitude is in X. To make it a bit more of a challenge, you can only use the stack, and must leave L, Z and T untouched.
Basically, perform a X<>Y when abs(X) > abs(Y).
When the magnitudes are equal, you have a choice.
BTW should you need a test
X>=a?
where a=0 or Y, present on the 42S but not on the 41, do
X<a?
X=a?
instead, in succession.

Good luck, Werner

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
[41/42/..] Micro-challenge: order X and Y by magnitude - Werner - 03-08-2016 01:53 PM



User(s) browsing this thread: 1 Guest(s)