new tasks
This commit is contained in:
parent
2a4d27cea0
commit
80737d5a6a
1194 changed files with 15353 additions and 1 deletions
8
Task/Arrays/Prolog/arrays-2.pro
Normal file
8
Task/Arrays/Prolog/arrays-2.pro
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
destructive:-
|
||||
functor(Array,array,100), % create a term with 100 free Variables as arguments
|
||||
% index of arguments start at 1
|
||||
setarg(1 ,Array,a), % put an a at position 1
|
||||
setarg(12,Array,b), % put an b at position 12
|
||||
setarg(1, Array,c), % overwrite value at position 1 with c
|
||||
arg(1 ,Array,Value1), % get the value at position 1
|
||||
print(Value1),nl. % will print Value1 and therefore c followed by a newline
|
||||
Loading…
Add table
Add a link
Reference in a new issue