Data update
This commit is contained in:
parent
ed705008a8
commit
0df55f9f24
2196 changed files with 32999 additions and 3075 deletions
|
|
@ -0,0 +1,8 @@
|
|||
100 INPUT "STRING";S$
|
||||
110 FOR I=1 TO INT(LEN(S$)/2)
|
||||
120 : J=LEN(S$)+1-I
|
||||
130 : T$=MID$(S$,I,1)
|
||||
140 : MID$(S$,I,1) = MID$(S$,J,1)
|
||||
150 : MID$(S$,J,1) = T$
|
||||
160 NEXT I
|
||||
170 PRINT S$
|
||||
|
|
@ -1,39 +1,17 @@
|
|||
-- The import on the next line provides the reverse string
|
||||
-- functionality satisfying the rosettacode.org task description.
|
||||
import String exposing (reverse)
|
||||
module Main exposing (main)
|
||||
|
||||
-- The rest is fairly boilerplate code demonstrating
|
||||
-- interactively that the reverse function works.
|
||||
import Html exposing (Html, Attribute, text, div, input)
|
||||
import Html.Attributes exposing (placeholder, value, style)
|
||||
import Html.Events exposing (on, targetValue)
|
||||
import Html.App exposing (beginnerProgram)
|
||||
import Html exposing (Html, text, div, p)
|
||||
import Html.Attributes exposing (style)
|
||||
|
||||
main = beginnerProgram { model = "", view = view, update = update }
|
||||
|
||||
update newStr oldStr = newStr
|
||||
change myText =
|
||||
text ("reverse " ++ myText
|
||||
++ " = " ++ String.reverse myText)
|
||||
|
||||
view : String -> Html String
|
||||
view forward =
|
||||
div []
|
||||
([ input
|
||||
[ placeholder "Enter a string to be reversed."
|
||||
, value forward
|
||||
, on "input" targetValue
|
||||
, myStyle
|
||||
]
|
||||
[]
|
||||
] ++
|
||||
[ let backward = reverse forward
|
||||
in div [ myStyle] [text backward]
|
||||
])
|
||||
|
||||
myStyle : Attribute msg
|
||||
myStyle =
|
||||
style
|
||||
[ ("width", "100%")
|
||||
, ("height", "20px")
|
||||
, ("padding", "5px 0 0 5px")
|
||||
, ("font-size", "1em")
|
||||
, ("text-align", "left")
|
||||
main =
|
||||
div [style "margin" "5%", style "font-size" "1.5em"]
|
||||
[change "as⃝da"
|
||||
, p [] [change "a⃝su-as⃝u"]
|
||||
, p [] [change "Hello!"]
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
writeln cp2s reverse s2cp q(don't you know)
|
||||
writeln reverse "don't you know"
|
||||
|
|
|
|||
9
Task/Reverse-a-string/Refal/reverse-a-string.refal
Normal file
9
Task/Reverse-a-string/Refal/reverse-a-string.refal
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
$ENTRY Go {
|
||||
= <Prout <Reverse 'asdf'>>;
|
||||
};
|
||||
|
||||
Reverse {
|
||||
(e.X) = e.X;
|
||||
(e.X) s.C e.Y = <Reverse (s.C e.X) e.Y>;
|
||||
e.X = <Reverse () e.X>;
|
||||
};
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
$ include "seed7_05.s7i";
|
||||
|
||||
const func string: reverse (in string: stri) is func
|
||||
const func string: reverso(in string: stri) is func
|
||||
result
|
||||
var string: result is "";
|
||||
local
|
||||
|
|
@ -13,5 +13,5 @@ const func string: reverse (in string: stri) is func
|
|||
|
||||
const proc: main is func
|
||||
begin
|
||||
writeln(reverse("Was it a cat I saw"));
|
||||
writeln(reverso("Was it a cat I saw"));
|
||||
end func;
|
||||
6
Task/Reverse-a-string/Seed7/reverse-a-string-2.seed7
Normal file
6
Task/Reverse-a-string/Seed7/reverse-a-string-2.seed7
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
$ include "seed7_05.s7i";
|
||||
|
||||
const proc: main is func
|
||||
begin
|
||||
writeln(reverse("Was it a cat I saw?"));
|
||||
end func;
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import "/str" for Str
|
||||
import "/upc" for Graphemes
|
||||
import "./str" for Str
|
||||
import "./upc" for Graphemes
|
||||
|
||||
for (word in ["asdf", "josé", "møøse", "was it a car or a cat I saw", "😀🚂🦊"]) {
|
||||
System.print(Str.reverse(word))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue