Time for an 2014 update…
This commit is contained in:
parent
372c577f83
commit
09687c4926
2520 changed files with 34227 additions and 7318 deletions
4
Task/Copy-a-string/BASIC/copy-a-string-1.basic
Normal file
4
Task/Copy-a-string/BASIC/copy-a-string-1.basic
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
100 DEF FN P(A) = PEEK (A) + PEEK(A + 1) * 256 : FOR I = FN P(105) TO FN P(107) - 1 STEP 7 : ON PEEK(I + 1) < 128 OR PEEK(I) > 127 GOTO 130 : ON LEFT$(P$, 1) <> CHR$(PEEK(I)) GOTO 130
|
||||
110 IF LEN(P$) > 1 THEN ON PEEK(I + 1) = 128 GOTO 130 : IF MID$(P$, 2, 1) <> CHR$(PEEK(I + 1) - 128) GOTO 130
|
||||
120 POKE I + 4, P / 256 : POKE I + 3, P - PEEK(I + 4) * 256 : RETURN
|
||||
130 NEXT I : STOP
|
||||
2
Task/Copy-a-string/BASIC/copy-a-string-2.basic
Normal file
2
Task/Copy-a-string/BASIC/copy-a-string-2.basic
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
S$ = "HELLO" : REM S$ IS THE ORIGINAL STRING
|
||||
C$ = S$ : REM C$ IS THE COPY
|
||||
3
Task/Copy-a-string/BASIC/copy-a-string-3.basic
Normal file
3
Task/Copy-a-string/BASIC/copy-a-string-3.basic
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
P$ = "S" : P = 53637 : GOSUB 100"POINT STRING S AT SOMETHING ELSE
|
||||
?S$
|
||||
?C$
|
||||
|
|
@ -1,13 +1,10 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
|
||||
int main( ) {
|
||||
std::string original ( "This is the original" ) ;
|
||||
std::string mycopy( original.length( ) , ' ' ) ;
|
||||
std::copy ( original.begin( ) , original.end( ) , mycopy.begin( ) ) ;
|
||||
std::cout << "This is the copy: " << mycopy << std::endl ;
|
||||
original.assign( "Now we change the original! " ) ;
|
||||
std::cout << "mycopy still is " << mycopy << std::endl ;
|
||||
return 0 ;
|
||||
std::string original ("This is the original");
|
||||
std::string my_copy = original;
|
||||
std::cout << "This is the copy: " << my_copy << std::endl;
|
||||
original = "Now we change the original! ";
|
||||
std::cout << "my_copy still is " << my_copy << std::endl;
|
||||
}
|
||||
|
|
|
|||
3
Task/Copy-a-string/Deja-Vu/copy-a-string.djv
Normal file
3
Task/Copy-a-string/Deja-Vu/copy-a-string.djv
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
local :orgininal "this is the original"
|
||||
local :scopy concat( original "" )
|
||||
!. scopy
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
src = "string"
|
||||
dest = src
|
||||
src = "string";
|
||||
dest = src;
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
src = "this is a string"
|
||||
<br><br>Note that all REXX values (variables) are stored as character strings.
|
||||
dst = src
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue