Re: Arrange them [ updated ]



On Nov 21, 5:08 pm, Nimo <azeez...@xxxxxxxxx> wrote:
On Nov 21, 8:22 pm, dan73 <fasttrac...@xxxxxxx> wrote:





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.

No, not encryption methods, but compression technique.

Wow, your algorithm is great,

now lets see you arranged some thing
like this 11000011110111  into
10 10 10 .....

its fine, now we can write it as n(10)
say,if n = 5
i.e 10 10 10

with this again "trying" to 'reproduce'

original  11000011110111

some of the members are saying it's impossible
and waste of time.

I have no idea what you are going on about. The paired string gives
you a little information about the original string (specifically, how
many 0's and 1's). If you save sufficient additional information about
the original string (in whatever form) then obviously you can
reconstruct it. If you don't then obviously you can't.
.



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 ... 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 ...
    (sci.math)
  • Re: Hourglass wont display while code executes
    ... It doesn't wait for the subform to retrieve the records. ... to assigning SQL to the RecordSource, then create a loop that will run until ... Dim dteLoop As Date, intWait As Integer ... criteria generated by passing other values in controls through specialized ...
    (microsoft.public.access.forms)
  • Re: Creating variables in a loop!
    ... Any hints on how I might be able to retrieve the boolean state of each ... You can retrieve them the same way: loop through the Cells collection ... and find the first control inside that cell. ... It's "just" a Control, so you will have to cast it to a CheckBox. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: vbscript logon script getting return data from sql sp
    ... > One way to retrieve values from a stored procedure is with a Recordset ... then the Do Until adoRecordset.EOF loop above loops ...
    (microsoft.public.scripting.vbscript)
  • Re: Creating variables in a loop!
    ... Mark, thanks for the response, I appreciate it. ... retrieve the information back from the ... of the loop and doesn't exist outside it. ... CheckBox chk = new CheckBox; ...
    (microsoft.public.dotnet.framework.aspnet)