Data update

This commit is contained in:
Ingy döt Net 2023-12-16 21:33:55 -08:00
parent 35bcdeebf8
commit 74c69a0df6
2427 changed files with 31826 additions and 3468 deletions

View file

@ -0,0 +1,14 @@
dim test = {"a", "bb", "ccc", "ddd", "ee", "f", "ggg"}
test1 = ""
for c = 0 to test[?]-1
if length(test[c]) > length(test1) Then
test1 = test[c]
test2 = test1 & chr(10)
else
if length(test[c]) = length(test1) then test2 += test[c] & chr(10)
end if
next c
print test2
end

View file

@ -0,0 +1,18 @@
Cmp {
𝕊 : 0; · 𝕊 : 1; 𝕊 ·: 2;
𝕨 𝕊(1) 𝕩
}
cr@+10
•Out {𝕊:
(•Getline@){
@ Longest 𝕩: 𝕩.str;
𝕨 Longest 𝕩:
(•Getline@) Longest 𝕨 {𝕨Cmp𝕩.curr}
{curr𝕨,str𝕩.strcr𝕨}
{curr𝕨,str𝕨}
𝕩
}𝕩
}{curr"",str""}

View file

@ -0,0 +1,8 @@
10 data "a","bb","ccc","ddd","ee","f","ggg","~" : ' la tilde es solo para mantener el código compacto
20 restore
30 read test$
40 if test$ = "~" then goto 70
50 if len(test$) > len(test1$) then test1$ = test$ : test2$ = test1$+chr$(10) else if len(test$) = len(test1$) then test2$ = test2$+test$+chr$(10)
60 goto 30
70 print test2$
80 end

View file

@ -0,0 +1,9 @@
10 DATA "a","bb","ccc","ddd","ee","f","ggg","~"
20 RESTORE
30 READ TEST$
40 IF TEST$ = "~" THEN GOTO 80
50 IF LEN(TEST$) > LEN(TEST1$) THEN LET TEST1$ = TEST$ : LET TEST2$ = TEST1$ + CHR$(10) : GOTO 30
60 IF LEN(TEST$) = LEN(TEST1$) THEN LET TEST2$ = TEST2$ + TEST$ + CHR$(10)
70 GOTO 30
80 PRINT TEST2$
90 END

View file

@ -0,0 +1,8 @@
10 DATA "a","bb","ccc","ddd","ee","f","ggg","~"
30 READ T$
40 IF T$ = "~" THEN GOTO 80
50 IF LEN(T$) > LEN(T1$) THEN LET T1$ = T$ : LET T2$ = T1$ + CHR$(10) : GOTO 30
60 IF LEN(T$) = LEN(T1$) THEN LET T2$ = T2$ + T$ + CHR$(10)
70 GOTO 30
80 PRINT T2$
90 END

View file

@ -0,0 +1,21 @@
string.isLonger = function(s)
return self.hasIndex(s.len)
end function
longest = ""
lines = ""
current = input
while current
if current.isLonger(longest) then
lines = current
longest = current
else if not longest.isLonger(current) then
lines += current
end if
current = input
end while
for i in range(0, lines.len, longest.len)
print lines[i:i + longest.len]
end for

View file

@ -0,0 +1,32 @@
[ 0 ] is alonger
[ 1 ] is blonger
[ 2 ] is a&bsame
[ [] swap witheach
[ drop blonger join ]
[] rot witheach
[ drop alonger join ]
over dip dup
witheach [ drop -1 split drop ]
unrot
witheach [ drop -1 split drop ]
join
a&bsame join
0 peek ] is comparison ( $ $ --> c )
[ say "Enter an empty string to end."
cr cr
$ "" $ ""
[ $ "Enter a string: " input
dup $ "" comparison
[ table
true true false ] do while
carriage join
2dup comparison
[ table
[ drop ]
[ dip [ 2drop $ "" ] ]
[ dip join ] ]
do again ]
cr say "Result:" cr
drop join echo$ ] is task ( --> )