Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
25
Task/Forward-difference/Ring/forward-difference.ring
Normal file
25
Task/Forward-difference/Ring/forward-difference.ring
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# Project : Forward difference
|
||||
|
||||
s = [90, 47, 58, 29, 22, 32, 55, 5, 55, 73]
|
||||
for p = 1 to 9
|
||||
s = fwddiff(s)
|
||||
showarray(s)
|
||||
next
|
||||
|
||||
func fwddiff(s)
|
||||
for j=1 to len(s)-1
|
||||
s[j] = s[j+1]-s[j]
|
||||
next
|
||||
n = len(s)
|
||||
del(s, n)
|
||||
return s
|
||||
|
||||
func showarray(vect)
|
||||
see "{"
|
||||
svect = ""
|
||||
for n = 1 to len(vect)
|
||||
svect = svect + vect[n] + ", "
|
||||
next
|
||||
svect = left(svect, len(svect) - 2)
|
||||
see svect
|
||||
see "}" + nl
|
||||
Loading…
Add table
Add a link
Reference in a new issue