Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
9
Task/String-append/Ada/string-append.adb
Normal file
9
Task/String-append/Ada/string-append.adb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
|
||||
with Ada.Text_IO.Unbounded_Io; use Ada.Text_IO.Unbounded_IO;
|
||||
|
||||
procedure String_Append is
|
||||
Str : Unbounded_String := To_Unbounded_String("Hello");
|
||||
begin
|
||||
Append(Str, ", world!");
|
||||
Put_Line(Str);
|
||||
end String_Append;
|
||||
23
Task/String-append/COBOL/string-append.cob
Normal file
23
Task/String-append/COBOL/string-append.cob
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
identification division.
|
||||
program-id. string-append.
|
||||
|
||||
data division.
|
||||
working-storage section.
|
||||
01 some-string.
|
||||
05 elements pic x occurs 0 to 80 times depending on limiter.
|
||||
01 limiter usage index value 7.
|
||||
01 current usage index.
|
||||
|
||||
procedure division.
|
||||
append-main.
|
||||
|
||||
move "Hello, " to some-string
|
||||
|
||||
*> extend the limit and move using reference modification
|
||||
set current to length of some-string
|
||||
set limiter up by 5
|
||||
move "world" to some-string(current + 1:)
|
||||
display some-string
|
||||
|
||||
goback.
|
||||
end program string-append.
|
||||
3
Task/String-append/Crystal/string-append.cr
Normal file
3
Task/String-append/Crystal/string-append.cr
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
s = "hello"
|
||||
s += " world!"
|
||||
p s
|
||||
3
Task/String-append/Emacs-Lisp/string-append-1.el
Normal file
3
Task/String-append/Emacs-Lisp/string-append-1.el
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
(defvar str "foo")
|
||||
(setq str (concat str "bar"))
|
||||
str ;=> "foobar"
|
||||
5
Task/String-append/Emacs-Lisp/string-append-2.el
Normal file
5
Task/String-append/Emacs-Lisp/string-append-2.el
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
(require 'cl-lib)
|
||||
|
||||
(defvar str "foo")
|
||||
(cl-callf concat str "bar")
|
||||
str ;=> "foobar"
|
||||
8
Task/String-append/Emacs-Lisp/string-append-3.el
Normal file
8
Task/String-append/Emacs-Lisp/string-append-3.el
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
(let ((buf (get-buffer-create "*foo*")))
|
||||
(with-current-buffer buf
|
||||
(insert "foo"))
|
||||
(with-current-buffer buf
|
||||
(goto-char (point-max))
|
||||
(insert "bar")
|
||||
(buffer-string)))
|
||||
;; => "foobar"
|
||||
7
Task/String-append/Euphoria/string-append.eu
Normal file
7
Task/String-append/Euphoria/string-append.eu
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
sequence string = "String"
|
||||
|
||||
printf(1,"%s\n",{string})
|
||||
|
||||
string &= " is now longer\n"
|
||||
|
||||
printf(1,"%s",{string})
|
||||
2
Task/String-append/Gleam/string-append.gleam
Normal file
2
Task/String-append/Gleam/string-append.gleam
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
let s = "Hello"
|
||||
s <> " world"
|
||||
|
|
@ -7,6 +7,8 @@ a$+="(one)"
|
|||
Print a$
|
||||
|
||||
Document b$
|
||||
b$="1234"
|
||||
Clear b$ ' use Clear to empty document
|
||||
b$="ok"
|
||||
b$="(one)"
|
||||
Print b$
|
||||
|
|
|
|||
3
Task/String-append/Pluto/string-append.pluto
Normal file
3
Task/String-append/Pluto/string-append.pluto
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
local s = "Rosetta"
|
||||
s ..= " Code"
|
||||
print(s)
|
||||
3
Task/String-append/PowerShell/string-append.ps1
Normal file
3
Task/String-append/PowerShell/string-append.ps1
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
$str = "Hello, "
|
||||
$str += "World!"
|
||||
$str
|
||||
115
Task/String-append/RISC-V-Assembly/string-append.asm
Normal file
115
Task/String-append/RISC-V-Assembly/string-append.asm
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
# riscv assembly raspberry pico2 rp2350
|
||||
# program appstring.s
|
||||
# connexion putty com3
|
||||
/*********************************************/
|
||||
/* CONSTANTES */
|
||||
/********************************************/
|
||||
/* for this file see risc-v task include a file */
|
||||
.include "../../constantesRiscv.inc"
|
||||
.equ BUFFERSIZE, 100
|
||||
/*******************************************/
|
||||
/* INITIALED DATAS */
|
||||
/*******************************************/
|
||||
.data
|
||||
szMessStart: .asciz "Program riscv start.\r\n"
|
||||
szMessEndOk: .asciz "Program riscv end OK.\r\n"
|
||||
szCariageReturn: .asciz "\r\n"
|
||||
|
||||
szMessString: .asciz "String :\n"
|
||||
szString1: .asciz "Alphabet : "
|
||||
sComplement: .fill BUFFERSIZE,1,0
|
||||
szString2: .asciz "abcdefghijklmnopqrstuvwxyz"
|
||||
|
||||
.align 2
|
||||
/*******************************************/
|
||||
/* UNINITIALED DATA */
|
||||
/*******************************************/
|
||||
.bss
|
||||
.align 2
|
||||
|
||||
/**********************************************/
|
||||
/* SECTION CODE */
|
||||
/**********************************************/
|
||||
.text
|
||||
.global main
|
||||
|
||||
main:
|
||||
call stdio_init_all # général init
|
||||
1: # start loop connexion
|
||||
li a0,0 # raz argument register
|
||||
call tud_cdc_n_connected # waiting for USB connection
|
||||
beqz a0,1b # return code = zero ?
|
||||
|
||||
la a0,szMessStart # message address
|
||||
call writeString # display message
|
||||
|
||||
la a0,szMessString # message address
|
||||
call writeString # display message
|
||||
la a0,szString1 # message address
|
||||
call writeString # display message
|
||||
la a0,szCariageReturn # message address
|
||||
call writeString # display message
|
||||
|
||||
la a0,szMessString # message address
|
||||
call writeString # display message
|
||||
la a0,szString2 # message address
|
||||
call writeString # display message
|
||||
la a0,szCariageReturn # message address
|
||||
call writeString # display message
|
||||
|
||||
la a0,szString1
|
||||
la a1,szString2
|
||||
call append
|
||||
|
||||
la a0,szMessString # message address
|
||||
call writeString # display message
|
||||
la a0,szString1 # message address
|
||||
call writeString # display message
|
||||
la a0,szCariageReturn # message address
|
||||
call writeString # display message
|
||||
|
||||
la a0,szMessEndOk # message address
|
||||
call writeString # display message
|
||||
call getchar
|
||||
100: # final loop
|
||||
j 100b
|
||||
|
||||
/*********************************************/
|
||||
/* add string to string */
|
||||
/*********************************************/
|
||||
/* no verfication size complement buffer */
|
||||
/* a0 contains address String 1 */
|
||||
/* a1 contains address String 2 */
|
||||
append:
|
||||
addi sp, sp, -4
|
||||
sw ra, 0(sp)
|
||||
li t0,0 # counter byte string 1
|
||||
1:
|
||||
add t1,a0,t0
|
||||
lbu t2,(t1) # load byte string 1
|
||||
beqz t2,2f # zero final ?
|
||||
addi t0,t0,1 # no -> increment counter
|
||||
j 1b # loop
|
||||
2:
|
||||
li t3, 0 # counter byte string 2
|
||||
3:
|
||||
add t4,a1,t3
|
||||
lbu t5,(t4) # load byte string 2
|
||||
add t1,a0,t0
|
||||
sb t5,(t1) # store byte string 1
|
||||
beqz t5,100f # zero final ? -> end
|
||||
addi t3,t3,1 # increment counter
|
||||
addi t0,t0,1
|
||||
j 3b # end loop
|
||||
|
||||
100:
|
||||
lw ra, 0(sp)
|
||||
addi sp, sp, 4
|
||||
ret
|
||||
|
||||
|
||||
/************************************/
|
||||
/* file include Fonctions */
|
||||
/***********************************/
|
||||
/* for this file see risc-v task include a file */
|
||||
.include "../../includeFunctions.s"
|
||||
2
Task/String-append/Rye/string-append.rye
Normal file
2
Task/String-append/Rye/string-append.rye
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
var 's "hello"
|
||||
append! " world" 's
|
||||
3
Task/String-append/VBScript/string-append.vbs
Normal file
3
Task/String-append/VBScript/string-append.vbs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
s = "Rosetta"
|
||||
s = s & " Code"
|
||||
WScript.StdOut.Write s
|
||||
Loading…
Add table
Add a link
Reference in a new issue