How to resolve the algorithm Show ASCII table step by step in the Ring programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Show ASCII table step by step in the Ring programming language

Table of Contents

Problem Statement

Show  the ASCII character set  from values   32   to   127   (decimal)   in a table format.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Show ASCII table step by step in the Ring programming language

Source code in the ring programming language

# Project : Show Ascii table

load "guilib.ring"
load "stdlib.ring"

decarr = newlist(16,6)
ascarr = newlist(16,6)

new qapp 
        {
        win1 = new qwidget() {
                  setwindowtitle("Show Ascii table")
                  setgeometry(100,100,800,600)
                  for n = 1 to 16
                       for m = 1 to 6
                            decarr[n][m] = new qpushbutton(win1) {
                                                  x = 150+m*60
                                                  y = 30 + n*30
                                                  ind = string((m-1)*16+n+31)
                                                  setgeometry(x,y,30,30)
                                                  settext(ind)
                                                  }
                       next
                  next
                  for n = 1 to 16
                       for m = 1 to 6
                            ascarr[n][m] = new qpushbutton(win1) {
                                                  x = 180+m*60
                                                  y = 30 + n*30
                                                  ind = (m-1)*16+n+31
                                                  setgeometry(x,y,30,30)
                                                  if ind = 32
                                                     settext("Spc")
                                                     loop
                                                  ok
                                                  if ind = 127
                                                     settext("Del")
                                                     loop
                                                  ok
                                                  settext(char(ind))
                                                  }
                       next
                  next
                  show()
        }
        exec()
        }

  

You may also check:How to resolve the algorithm Disarium numbers step by step in the Python programming language
You may also check:How to resolve the algorithm Evolutionary algorithm step by step in the MATLAB programming language
You may also check:How to resolve the algorithm Semordnilap step by step in the BBC BASIC programming language
You may also check:How to resolve the algorithm Ackermann function step by step in the NewLISP programming language
You may also check:How to resolve the algorithm Terminal control/Clear the screen step by step in the Befunge programming language