September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
17
Task/Copy-a-string/360-Assembly/copy-a-string.360
Normal file
17
Task/Copy-a-string/360-Assembly/copy-a-string.360
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
* Duplicate a string
|
||||
MVC A,=CL64'Hello' a='Hello'
|
||||
MVC B,A b=a memory copy
|
||||
MVC A,=CL64'Goodbye' a='Goodbye'
|
||||
XPRNT A,L'A print a
|
||||
XPRNT B,L'B print b
|
||||
...
|
||||
* Make reference to a string a string
|
||||
MVC A,=CL64'Hi!' a='Hi!'
|
||||
LA R1,A r1=@a set pointer
|
||||
ST R1,REFA refa=@a store pointer
|
||||
XPRNT A,L'A print a
|
||||
XPRNT 0(R1),L'A print %refa
|
||||
...
|
||||
A DS CL64 a
|
||||
B DS CL64 b
|
||||
REFA DS A @a
|
||||
4
Task/Copy-a-string/BASIC/copy-a-string-4.basic
Normal file
4
Task/Copy-a-string/BASIC/copy-a-string-4.basic
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
a$ = "I am here"
|
||||
b$ = a$
|
||||
a$ = "Hello world..."
|
||||
PRINT a$, b$
|
||||
5
Task/Copy-a-string/BASIC/copy-a-string-5.basic
Normal file
5
Task/Copy-a-string/BASIC/copy-a-string-5.basic
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
a$ = "Hello world..."
|
||||
LOCAL b TYPE STRING
|
||||
b = a$
|
||||
a$ = "Goodbye..."
|
||||
PRINT a$, b
|
||||
7
Task/Copy-a-string/BASIC/copy-a-string-6.basic
Normal file
7
Task/Copy-a-string/BASIC/copy-a-string-6.basic
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
10 A$ = "HELLO"
|
||||
20 REM COPY CONTENTS OF A$ TO B$
|
||||
30 B$ = A$
|
||||
40 REM CHANGE CONTENTS OF A$
|
||||
50 A$ = "HI"
|
||||
60 REM DISPLAY CONTENTS
|
||||
70 PRINT A$, B$
|
||||
7
Task/Copy-a-string/BASIC/copy-a-string-7.basic
Normal file
7
Task/Copy-a-string/BASIC/copy-a-string-7.basic
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
10 LET A$="BECAUSE I DO NOT HOPE TO TURN AGAIN"
|
||||
20 LET B$=A$
|
||||
30 LET A$=A$( TO 21)
|
||||
40 PRINT B$
|
||||
50 PRINT A$
|
||||
60 LET B$=A$+B$(22 TO 29)
|
||||
70 PRINT B$
|
||||
3
Task/Copy-a-string/Dc/copy-a-string.dc
Normal file
3
Task/Copy-a-string/Dc/copy-a-string.dc
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[a string] # push "a string" on the main stack
|
||||
d # duplicate the top value
|
||||
f # show the current contents of the main stack
|
||||
63
Task/Copy-a-string/EDSAC-order-code/copy-a-string.edsac
Normal file
63
Task/Copy-a-string/EDSAC-order-code/copy-a-string.edsac
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
[ Copy a string
|
||||
=============
|
||||
|
||||
A program for the EDSAC
|
||||
|
||||
Copies the source string into storage
|
||||
tank 6, which is assumed to be free,
|
||||
and then prints it from there
|
||||
|
||||
Works with Initial Orders 2 ]
|
||||
|
||||
T56K
|
||||
GK
|
||||
|
||||
[ 0 ] A34@ [ copy the string ]
|
||||
[ 1 ] T192F
|
||||
[ 2 ] H34@
|
||||
C32@
|
||||
S32@
|
||||
E17@
|
||||
T31@
|
||||
A@
|
||||
A33@
|
||||
T@
|
||||
A1@
|
||||
A33@
|
||||
T1@
|
||||
A2@
|
||||
A33@
|
||||
T2@
|
||||
E@
|
||||
[ 17 ] O192F [ print the copy ]
|
||||
[ 18 ] H192F
|
||||
C32@
|
||||
S32@
|
||||
E30@
|
||||
T31@
|
||||
A17@
|
||||
A33@
|
||||
T17@
|
||||
A18@
|
||||
A33@
|
||||
T18@
|
||||
E17@
|
||||
[ 30 ] ZF
|
||||
[ 31 ] PF
|
||||
[ 32 ] PD
|
||||
[ 33 ] P1F
|
||||
[ 34 ] *F
|
||||
RF
|
||||
OF
|
||||
SF
|
||||
EF
|
||||
TF
|
||||
TF
|
||||
AF
|
||||
!F
|
||||
CF
|
||||
OF
|
||||
DF
|
||||
ED
|
||||
|
||||
EZPF
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
#var src := "Hello".
|
||||
#var dst := src. // copying the reference
|
||||
#var copy := src clone. // copying the content
|
||||
var src := "Hello".
|
||||
var dst := src. // copying the reference
|
||||
var copy := src clone. // copying the content
|
||||
|
|
|
|||
|
|
@ -1,4 +1,10 @@
|
|||
DIM src AS String
|
||||
DIM dst AS String
|
||||
Public Sub main()
|
||||
Dim src As String
|
||||
Dim dst As String
|
||||
|
||||
src = "Hello"
|
||||
dst = src
|
||||
|
||||
Print src
|
||||
Print dst
|
||||
End
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
val h = "Hello"
|
||||
val c = "" + h
|
||||
val s = "Hello"
|
||||
val alias = s // alias === s
|
||||
val copy = "" + s // copy !== s
|
||||
|
|
|
|||
18
Task/Copy-a-string/OoRexx/copy-a-string.rexx
Normal file
18
Task/Copy-a-string/OoRexx/copy-a-string.rexx
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/* Rexx ***************************************************************
|
||||
* 16.05.2013 Walter Pachl
|
||||
**********************************************************************/
|
||||
|
||||
s1 = 'This is a Rexx string'
|
||||
s2 = s1 /* does not copy the string */
|
||||
|
||||
Say 's1='s1
|
||||
Say 's2='s2
|
||||
i1=s1~identityhash; Say 's1~identityhash='i1
|
||||
i2=s2~identityhash; Say 's2~identityhash='i2
|
||||
|
||||
s2 = s2~changestr('*', '*') /* creates a modified copy */
|
||||
|
||||
Say 's1='s1
|
||||
Say 's2='s2
|
||||
i1=s1~identityhash; Say 's1~identityhash='i1
|
||||
i2=s2~identityhash; Say 's2~identityhash='i2
|
||||
1
Task/Copy-a-string/Zkl/copy-a-string.zkl
Normal file
1
Task/Copy-a-string/Zkl/copy-a-string.zkl
Normal file
|
|
@ -0,0 +1 @@
|
|||
"abc".copy() // noop
|
||||
Loading…
Add table
Add a link
Reference in a new issue