How to resolve the algorithm Multiplication tables step by step in the TUSCRIPT programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Multiplication tables step by step in the TUSCRIPT programming language
Table of Contents
Problem Statement
Produce a formatted 12×12 multiplication table of the kind memorized by rote when in primary (or elementary) school.
Only print the top half triangle of products.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Multiplication tables step by step in the TUSCRIPT programming language
Source code in the tuscript programming language
$$ MODE TUSCRIPT
x=y="1'2'3'4'5'6'7'8'9'10'11'12"
LOOP n,col=x,cnt=""
skip=n-1
LOOP m,row=y
IF (m==skip) THEN
td=""
ELSE
td=col*row
coleqrow=col*n
IF (td.lt.#coleqrow) td=""
ENDIF
td=CENTER (td,+3," ")
cnt=APPEND (cnt,td," ")
ENDLOOP
col=CENTER (col,+3," ")
PRINT col,cnt
ENDLOOP
You may also check:How to resolve the algorithm Move-to-front algorithm step by step in the JavaScript programming language
You may also check:How to resolve the algorithm Base64 decode data step by step in the Smalltalk programming language
You may also check:How to resolve the algorithm Terminal control/Display an extended character step by step in the bc programming language
You may also check:How to resolve the algorithm Roman numerals/Encode step by step in the BQN programming language
You may also check:How to resolve the algorithm Calculating the value of e step by step in the Joy programming language