Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
2
Task/Repeat-a-string/ANSI-BASIC/repeat-a-string.basic
Normal file
2
Task/Repeat-a-string/ANSI-BASIC/repeat-a-string.basic
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
10 PRINT REPEAT$("ha", 5)
|
||||
20 END
|
||||
7
Task/Repeat-a-string/Ada/repeat-a-string.adb
Normal file
7
Task/Repeat-a-string/Ada/repeat-a-string.adb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
with Ada.Strings.Fixed; use Ada.Strings.Fixed;
|
||||
with Ada.Text_IO; use Ada.Text_IO;
|
||||
|
||||
procedure String_Multiplication is
|
||||
begin
|
||||
Put_Line (5 * "ha");
|
||||
end String_Multiplication;
|
||||
3
Task/Repeat-a-string/ArkScript/repeat-a-string.ark
Normal file
3
Task/Repeat-a-string/ArkScript/repeat-a-string.ark
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
(import std.String)
|
||||
|
||||
(print (string:repeat "ha" 5))
|
||||
3
Task/Repeat-a-string/AutoIt/repeat-a-string.au3
Normal file
3
Task/Repeat-a-string/AutoIt/repeat-a-string.au3
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#include <String.au3>
|
||||
|
||||
ConsoleWrite(_StringRepeat("ha", 5) & @CRLF)
|
||||
16
Task/Repeat-a-string/Ballerina/repeat-a-string.ballerina
Normal file
16
Task/Repeat-a-string/Ballerina/repeat-a-string.ballerina
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// https://rosettacode.org/wiki/Repeat_a_string
|
||||
import ballerina/io;
|
||||
|
||||
function repeat(int l, string s) returns string {
|
||||
string[] out = [];
|
||||
foreach int _ in 1...l {
|
||||
out.push(s);
|
||||
}
|
||||
return "".concat(...out);
|
||||
}
|
||||
|
||||
public function main() {
|
||||
io:println(repeat(5, "ha"));
|
||||
// Repeat a character:
|
||||
io:println("".padEnd(5, "x"));
|
||||
}
|
||||
9
Task/Repeat-a-string/COBOL/repeat-a-string.cob
Normal file
9
Task/Repeat-a-string/COBOL/repeat-a-string.cob
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
IDENTIFICATION DIVISION.
|
||||
PROGRAM-ID. REPEAT-PROGRAM.
|
||||
DATA DIVISION.
|
||||
WORKING-STORAGE SECTION.
|
||||
77 HAHA PIC A(10).
|
||||
PROCEDURE DIVISION.
|
||||
MOVE ALL 'ha' TO HAHA.
|
||||
DISPLAY HAHA.
|
||||
STOP RUN.
|
||||
1
Task/Repeat-a-string/Emacs-Lisp/repeat-a-string-1.el
Normal file
1
Task/Repeat-a-string/Emacs-Lisp/repeat-a-string-1.el
Normal file
|
|
@ -0,0 +1 @@
|
|||
(apply 'concat (make-list 5 "ha"))
|
||||
1
Task/Repeat-a-string/Emacs-Lisp/repeat-a-string-2.el
Normal file
1
Task/Repeat-a-string/Emacs-Lisp/repeat-a-string-2.el
Normal file
|
|
@ -0,0 +1 @@
|
|||
(make-string 5 ?x)
|
||||
2
Task/Repeat-a-string/Emacs-Lisp/repeat-a-string-3.el
Normal file
2
Task/Repeat-a-string/Emacs-Lisp/repeat-a-string-3.el
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
(require 'cl-lib)
|
||||
(cl-loop repeat 5 concat "ha")
|
||||
5
Task/Repeat-a-string/Euphoria/repeat-a-string-1.eu
Normal file
5
Task/Repeat-a-string/Euphoria/repeat-a-string-1.eu
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
sequence s = ""
|
||||
for i = 1 to 5 do s &= "ha" end for
|
||||
puts(1,s)
|
||||
|
||||
hahahahaha
|
||||
3
Task/Repeat-a-string/Euphoria/repeat-a-string-2.eu
Normal file
3
Task/Repeat-a-string/Euphoria/repeat-a-string-2.eu
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
sequence s = repeat('*',5)
|
||||
|
||||
*****
|
||||
9
Task/Repeat-a-string/Euphoria/repeat-a-string-3.eu
Normal file
9
Task/Repeat-a-string/Euphoria/repeat-a-string-3.eu
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
include std/console.e -- for display
|
||||
include std/sequence.e -- for repeat_pattern
|
||||
sequence s = repeat_pattern("ha",5)
|
||||
sequence n = repeat_pattern({1,2,3},5)
|
||||
display(s)
|
||||
display(n)
|
||||
|
||||
hahahahaha
|
||||
{1,2,3,1,2,3,1,2,3,1,2,3,1,2,3}
|
||||
4
Task/Repeat-a-string/Euphoria/repeat-a-string-4.eu
Normal file
4
Task/Repeat-a-string/Euphoria/repeat-a-string-4.eu
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
include std/console.e -- for display
|
||||
include std/sequence.e -- for flatten
|
||||
sequence s = flatten(repeat("ha",5))
|
||||
display(s)
|
||||
7
Task/Repeat-a-string/Euphoria/repeat-a-string-5.eu
Normal file
7
Task/Repeat-a-string/Euphoria/repeat-a-string-5.eu
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"ha",
|
||||
"ha",
|
||||
"ha",
|
||||
"ha",
|
||||
"ha"
|
||||
}
|
||||
5
Task/Repeat-a-string/Gleam/repeat-a-string.gleam
Normal file
5
Task/Repeat-a-string/Gleam/repeat-a-string.gleam
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import gleam/string
|
||||
|
||||
pub fn main() {
|
||||
echo string.repeat("hello", 3)
|
||||
}
|
||||
13
Task/Repeat-a-string/LOLCODE/repeat-a-string.lol
Normal file
13
Task/Repeat-a-string/LOLCODE/repeat-a-string.lol
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
HAI 1.3
|
||||
|
||||
HOW IZ I STRREP YR S AN YR N
|
||||
I HAS A OUTPUT ITZ ""
|
||||
IM IN YR LOOP UPPIN YR M TIL BOTH SAEM N AN M
|
||||
OUTPUT R SMOOSH OUTPUT S MKAY
|
||||
IM OUTTA YR LOOP
|
||||
FOUND YR OUTPUT
|
||||
IF U SAY SO
|
||||
|
||||
VISIBLE I IZ STRREP YR "HA" AN YR 5 MKAY
|
||||
|
||||
KTHXBYE
|
||||
1
Task/Repeat-a-string/PowerShell/repeat-a-string.ps1
Normal file
1
Task/Repeat-a-string/PowerShell/repeat-a-string.ps1
Normal file
|
|
@ -0,0 +1 @@
|
|||
"ha" * 5 # ==> "hahahahaha"
|
||||
12
Task/Repeat-a-string/QuickBASIC/repeat-a-string.basic
Normal file
12
Task/Repeat-a-string/QuickBASIC/repeat-a-string.basic
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
FUNCTION StringRepeat$ (s$, n)
|
||||
cad$ = ""
|
||||
FOR i = 1 TO n
|
||||
cad$ = cad$ + s$
|
||||
NEXT i
|
||||
StringRepeat$ = cad$
|
||||
END FUNCTION
|
||||
|
||||
PRINT StringRepeat$("rosetta", 1)
|
||||
PRINT StringRepeat$("ha", 5)
|
||||
PRINT StringRepeat$("*", 5)
|
||||
END
|
||||
1
Task/Repeat-a-string/ReScript/repeat-a-string.res
Normal file
1
Task/Repeat-a-string/ReScript/repeat-a-string.res
Normal file
|
|
@ -0,0 +1 @@
|
|||
Js.log(Js.String2.repeat("ha", 5))
|
||||
1
Task/Repeat-a-string/Rebol/repeat-a-string-1.rebol
Normal file
1
Task/Repeat-a-string/Rebol/repeat-a-string-1.rebol
Normal file
|
|
@ -0,0 +1 @@
|
|||
head insert/dup "" "ha" 5
|
||||
1
Task/Repeat-a-string/Rebol/repeat-a-string-2.rebol
Normal file
1
Task/Repeat-a-string/Rebol/repeat-a-string-2.rebol
Normal file
|
|
@ -0,0 +1 @@
|
|||
append/dup "" "ha" 5
|
||||
1
Task/Repeat-a-string/VBScript/repeat-a-string.vbs
Normal file
1
Task/Repeat-a-string/VBScript/repeat-a-string.vbs
Normal file
|
|
@ -0,0 +1 @@
|
|||
replace(string(5,"@"),"@","hello")
|
||||
Loading…
Add table
Add a link
Reference in a new issue