Well, I'm not sure what the issue is...
But from your code I see that there is some confusion.
If we read the documentation for char we notice the line
Turing Docs wrote:
The char type is an index type and can be used, for example, as subscripts, for ranges and case labels. For example, this declaration
This means that char can designate the range of all characters. But note that these are characters and not integers. (char is 8 bit, integer is 32 bit)
Turing: |
var __ : array char of boolean
% So we can't write
__ (1) := false
% But we can write
__ ('1') := false
% Which is the index of character 1
% This means we can't use
for i : lower (__ ) .. upper (__ )
/* something with*/ __ (i )
% Since lower and upper produces integers
|
So if we can't use numbers for indices, how can we run a for loop to go through all characters?
Simple, just read the line I quoted. "The char type [...] can be used [...] for ranges.
So the range of the for can be char. Example
Turing: |
for ch : char
/* something with*/ __ (i) |
Hope this helps.