Post Reply 
[VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" Special
05-05-2018, 10:00 AM
Post: #2
RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ...
Let's start with the easy part:
(05-04-2018 09:39 PM)Valentin Albillo Wrote:  Step the Fourth
...
Write a program which accepts a positive integer N from the user and outputs both the number and its square for every value from N down to 0, both included, one pair per line.
...
it must use no variables at all and no PEEK/POKE either

The challenge here is to use no variables (otherwise it's trivial).

Re-using a previous idea, here is my 41-byte solution:

10 DISP VAL(DISP$);RES*RES
20 DISP SQRT(RES)-1;RES*RES @ IF RES THEN 20

To use it, type the number N, DON'T press ENTER but RUN.

J-F
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [VA] Short & Sweet Math Challenges #23: "May the 4th Be With You !" ... - J-F Garnier - 05-05-2018 10:00 AM



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