Data update
This commit is contained in:
parent
0df55f9f24
commit
aec8ed51b6
1045 changed files with 18889 additions and 2777 deletions
31
Task/Set-consolidation/GW-BASIC/set-consolidation.basic
Normal file
31
Task/Set-consolidation/GW-BASIC/set-consolidation.basic
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
100 CLS
|
||||
110 S$ = "AB" : GOSUB 160
|
||||
120 S$ = "AB,CD" : GOSUB 160
|
||||
130 S$ = "AB,CD,DB" : GOSUB 160
|
||||
140 S$ = "HIK,AB,CD,DB,FGH" : GOSUB 160
|
||||
150 END
|
||||
160 DIM R$(20)
|
||||
170 N = 0
|
||||
180 FOR I = 1 TO LEN(S$)
|
||||
190 IF MID$(S$,I,1) = "," THEN N = N+1 : GOTO 210
|
||||
200 R$(N) = R$(N)+MID$(S$,I,1)
|
||||
210 NEXT I
|
||||
220 FOR I = 0 TO N
|
||||
230 P = I
|
||||
240 TS$ = ""
|
||||
250 FOR J = I TO 0 STEP -1
|
||||
260 IF TS$ = "" THEN P = J
|
||||
270 TS$ = ""
|
||||
280 FOR K = 1 TO LEN(R$(P))
|
||||
290 IF J > 0 THEN IF INSTR(R$(J-1),MID$(R$(P),K,1)) = 0 THEN TS$ = TS$+MID$(R$(P),K,1)
|
||||
300 NEXT K
|
||||
310 IF LEN(TS$) < LEN(R$(P)) THEN IF J > 0 THEN R$(J-1) = R$(J-1)+TS$ : R$(P) = "-" : TS$ = ""
|
||||
320 NEXT J
|
||||
330 NEXT I
|
||||
340 T$ = R$(0)
|
||||
350 FOR I = 1 TO N
|
||||
360 T$ = T$+","+R$(I)
|
||||
370 NEXT I
|
||||
380 PRINT S$;" = ";T$
|
||||
390 ERASE R$
|
||||
400 RETURN
|
||||
Loading…
Add table
Add a link
Reference in a new issue