(42S) challenge: repeat a character N times
|
01-15-2018, 12:38 PM
Post: #1
|
|||
|
|||
(42S) challenge: repeat a character N times
Suppose the alpha register contains a single character, and you want it duplicated N times, 0<=N<=44. This will come in handy when drawing lines on the DM-42 ;-)
A simple way would be Code: >LBL "$N" But that loops 44 times for the longest string. Can you do better & still preserve Y and Z? So, In: A: char Z: z Y: y X: N Out: A: N times char Y: z X: y My current attempt's worst case is about 2.5 times faster than the above, and still reasonably short at 49 bytes. Cheers, Werner 41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(42S) challenge: repeat a character N times - Werner - 01-15-2018 12:38 PM
RE: (42S) challenge: repeat a character N times - Didier Lachieze - 01-15-2018, 02:48 PM
RE: (42S) challenge: repeat a character N times - Thomas Okken - 01-15-2018, 03:13 PM
RE: (42S) challenge: repeat a character N times - Didier Lachieze - 01-15-2018, 03:18 PM
RE: (42S) challenge: repeat a character N times - Thomas Okken - 01-15-2018, 03:20 PM
RE: (42S) challenge: repeat a character N times - Werner - 01-15-2018, 03:46 PM
RE: (42S) challenge: repeat a character N times - wawa - 01-17-2018, 12:19 PM
RE: (42S) challenge: repeat a character N times - Werner - 01-17-2018, 12:56 PM
RE: (42S) challenge: repeat a character N times - Thomas Okken - 01-17-2018, 01:32 PM
RE: (42S) challenge: repeat a character N times - revwillie - 01-17-2018, 01:54 PM
|
User(s) browsing this thread: 5 Guest(s)