Re: Arrange them [ updated ]



Cobra wrote:

Thanks for the 'algorithm'

want to know one thing here,
can we again get the 'original sequence' back ? by this >procedure.

A lot less code than I thought!

I still can not understand your logic but here is the
new program that destroys A$ after it is retrieved by an
array in the first "I" loop on line 40.
This I loop also gives the two variables X and X1 there
values.

If A$ is destroyed in line 100 without rebuilding it first
the integrity of the original A$ is lost it cannot be
rebuilt from just the pairing values of X and X1.

Please enlighten me on your logic in all of this?

Are you investigating some sort of encryption method?

10 CLS
20 DIM B1$(34)
30 A$="1101100101101110010001000011110101":PRINT A$
40 FOR I=1 TO 34
50 REM I value at it's greatest equals the length of the string.
60 B$=MID$(A$,I,1)
70 IF B$="1" THEN X=X+1:B1$(I)="1":GOTO 90
80 X1=X1+1:B1$(I)="0"
90 NEXT I
100 PRINT "The pairing of this string is --":PRINT " ":A$=""
110 FOR I = 1 TO 18
120 REM (18) represents the total count of pairs and singles added together
140 IF X>0 AND X1>0 THEN PRINT "10 ";:X=X-1:X1=X1-1
150 IF X>0 AND X1=0 THEN PRINT "1 ";:X=X-1
160 IF X1>0 AND X=0 THEN PRINT "0 ";:Y=Y-1
170 NEXT I
190 PRINT " ":PRINT "New string values from array built
from first I loop on line 40 ="
200 FOR I=1 TO 34
210 PRINT B1$(I);
220 NEXT I
230 PRINT "": PRINT "Print A$";A$;" ---A$ was destroyed
on line 100 therefore now empty"
240 REM The only way to retrieve the original A$ before
its' destruction on line 100 is rebuild it in
the first I loop on line 40.
.



Relevant Pages

  • Re: Arrange them [ updated ]
    ... This I loop also gives the two variables X and X1 there ... If A$ is destroyed in line 100 without rebuilding it first ... Are you investigating some sort of encryption method? ... 50 REM I value at it's greatest equals the length of the string. ...
    (sci.math)
  • Re: Arrange them [ updated ]
    ... This I loop also gives the two variables X and X1 there ... 50 REM I value at it's greatest equals the length of the string. ... 240 REM The only way to retrieve the original A$ before ... you a little information about the original string (specifically, ...
    (sci.math)
  • recreate database script not work
    ... I got a script which is supposed to regenerate database systax. ... REM gen_dbse_9.sql ... end loop; ... exit when LOGFILE_CURSOR%NOTFOUND; ...
    (comp.databases.oracle.server)
  • Re: How do I use For loop to pick different Range of cells to Select & Merge?
    ... dim myRow as long ... I'm trying to loop through Ranges of Cells to select & merge them ... rem datastartrow is the row I'm on ... I need to loop through the rows.... ...
    (microsoft.public.excel.programming)
  • Re: I still dont get MAPCAN
    ... (loop for e in huge-list when (interestingp e) ... Still rebuilding after the weight of all those Java references collapsed the home? ...
    (comp.lang.lisp)