Two identical strings: Difference between revisions

Line 2,152:
 
=={{header|Liberty BASIC}}==
<lang liberty basic>'NotmaxNumber testing= 1 since it only has one binary digit1000
maxN = Int(Len(DecToBin$(maxNumber))/ 2)
For i = 2 To 1000
Print "Value"," Binary"
'Since 1 is obviously not applicable,
'just count to ((2^maxN) - 2); Using "- 2" because
'we know that ((2^5) - 1) = 1023 which is > 1000
For i = 21 To 1000((2^maxN) - 2)
bin$ = DecToBin$(i)
'Let's format the output nicely
'Only test those binary numbers where the number
Print (((2^Len(bin$))*i) + i),Space$((maxN * 2) - Len(bin$;bin$));bin$;bin$
'of digits is evenly divisible by 2
If Not(Len(bin$) Mod 2) Then
leftBin$ = Left$(bin$, (Len(bin$)/2))
rightBin$ = Right$(bin$, (Len(bin$)/2))
If (leftBin$ = rightBin$) Then
Print i;" - ";bin$
End If
End If
Next i
End
Line 2,178 ⟶ 2,176:
{{out}}
 
<pre>3Value - 11 Binary
3 Print i;" - ";bin$ 11
10 - 1010
10 1010
15 - 1111
15 1111
36 - 100100
45 - 101101
54 - 110110
63 - 111111
136 - 10001000
153 - 10011001
170 - 10101010
187 - 10111011
204 - 11001100
221 - 11011101
238 - 11101110
255 - 11111111
528 - 1000010000
561 - 1000110001
594 - 1001010010
627 - 1001110011
660 - 1010010100
693 - 1010110101
726 - 1011010110
759 - 1011110111
792 - 1100011000
825 - 1100111001
858 - 1101011010
891 - 1101111011
924 - 1110011100
957 - 1110111101
990 - 1111011110</pre>
 
=={{header|MAD}}==