Data update
This commit is contained in:
parent
0df55f9f24
commit
aec8ed51b6
1045 changed files with 18889 additions and 2777 deletions
|
|
@ -0,0 +1,5 @@
|
|||
10 input "Enter two positive integers, separated by a comma? ";i,j
|
||||
20 dim array(i,j)
|
||||
30 array(i,j) = i*j
|
||||
40 print "a(";str$(i);",";str$(j);") = ";array(i,j)
|
||||
50 erase array
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
10 INPUT "Enter two positive integers, separated by a comma"; I, J
|
||||
20 DIM ARRAY(I, J)
|
||||
30 ARRAY(I, J) = I * J
|
||||
40 PRINT "a("; STR$(I); ","; STR$(J); " ) ="; ARRAY(I, J)
|
||||
50 ERASE ARRAY
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
10 PRINT "ENTER ONE POSITIVE INTEGER: "
|
||||
20 INPUT I
|
||||
30 PRINT "ENTER OTHER POSITIVE INTEGER: "
|
||||
40 INPUT J
|
||||
50 LET A(I,J) = I*J
|
||||
60 PRINT "A(";I;",";J;") = ";A(I,J)
|
||||
70 END
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
:- dynamic array/2.
|
||||
|
||||
run :-
|
||||
write('Enter two positive integers, separated by a comma: '),
|
||||
read((I,J)),
|
||||
assert(array(I,J)),
|
||||
Value is I * J,
|
||||
format('a(~w,~w) = ~w', [I, J, Value]),
|
||||
retractall(array(_,_)).
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
var a, b = integer
|
||||
|
||||
print "Two-Dimensional Array Example"
|
||||
input "Size of first dimension"; a
|
||||
input "Size of second dimension"; b
|
||||
|
||||
dim integer test_array(a, b)
|
||||
|
||||
test_array(1,1) = 99 rem S-BASIC arrays are indexed from 1
|
||||
|
||||
print "Value stored at 1,1 ="; test_array(1,1)
|
||||
|
||||
end
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
PROGRAM "Create a two-dimensional array at runtime"
|
||||
VERSION "0.0001"
|
||||
|
||||
DECLARE FUNCTION Entry ()
|
||||
|
||||
FUNCTION Entry ()
|
||||
i$ = INLINE$("Enter one positive integer: ")
|
||||
j$ = INLINE$("Enter other positive integer: ")
|
||||
i = SSHORT(i$)
|
||||
j = SSHORT(j$)
|
||||
DIM a[i, j]
|
||||
a[i, j] = i * j
|
||||
PRINT "a("; STRING(i); ", "; STRING(j); ") ="; a[i, j]
|
||||
END FUNCTION
|
||||
Loading…
Add table
Add a link
Reference in a new issue