Author Topic: Error in code  (Read 2873 times)

0 Members and 1 Guest are viewing this topic.

Offline Ryster

  • Newbie
  • Posts: 77
    • View Profile
Error in code
« on: March 10, 2019, 08:05:57 am »
Welcome.
I do not know why there is a bug in 38 lines. Maybe someone will look and improve.
Code: QB64: [Select]
  1.  
J = 4682: M = 3
B = INT(((235 * J) + 1) / 19)
C = INT(B / 1095)
D = (B MOD 1095)
E = INT(((15 * C) + (765433 * D) + 12084) / 25920)
F = (32336 * C) + E
G = (F MOD 7)
H = INT((6 * G) / 7)
I = (H MOD 2)
K = INT(((235 * (J - 1)) + 1) / 19)
L = INT(K / 1095)
M = INT(K MOD 1095)
N = INT(((15 * L) + (765433 * M) + 12084) / 25920)
O = (32336 * L + N)
P = (O MOD 7)
R = INT((6 * P) / 7)
S = (R MOD 2)
T = INT(((235 * (J + 1)) + 1) / 19)
U = INT(T / 1095)
W = (T MOD 1095)
AA = INT(((15 * L) + (765433 * T) + 12084) / 25920)
AB = INT(T / 1095)
AC = (T MOD 1095)
AD = INT(((15 * AB) + (765433 * AC) + 12084) / 25920)
AE = 32336 * U + AA
AF = (AE MOD 7)
AG = INT((6 * AF) / 7)
AH = (AG MOD 2)
AI = INT(((235 * (J + 2)) + 1) / 19)
AJ = INT(AI / 1095)
AK = (AI MOD 1095)
AL = INT(((15 * AJ) + (765433 * AK) + 12084) / 25920)
AM = 32336 * AJ + AL
AN = (AM MOD 7)
AO = INT((6 * AN) / 7)
AP = (AO MOD 2)
AR = AE + AH - F
AS = F - O - S                               
AT = AM - (AE + AH)                           
AU = INT((AR + 19) / 15)                       
AW = (AU MOD 2)                               
AX = INT((AS + 7) / 15)                       
AY = INT((AT + 19) / 15)                     
AZ = (AY MOD 2)                               
AV = INT((AR + 7) / 15)                       
BA = F + 2 * AW + (AX MOD 2)                 
BC = 1710442 + 1 + 2 * AZ + (AY MOD 2)       
BD = BC - BA                                 
BE = INT((BD + 7) / 2)                       
BF = INT((385 - BA) / 2)                     
BG = INT(((384 * (M - 1)) + 7) / 13)         
BH = INT(((M - 1) + 4) / 12)                 
BI = INT(((M - 1) + 3) / 12)                 
C8 = (BE MOD 15)                             
C9 = -(BF MOD 15)                             
C3 = 59 + C8 * BH + C9 * BI   
C4 = C3 + BA
PRINT C4

Offline RhoSigma

  • QB64 Developer
  • Forum Resident
  • Posts: 565
    • View Profile
Re: Error in code
« Reply #1 on: March 10, 2019, 08:46:46 am »
"AS" is a reserved QB keyword like in "DIM var AS LONG", hence it cannot be used as variable, simply choose another name for that variable and replace all occurences of "AS" in your program with the new name.

My Projects:   https://qb64forum.alephc.xyz/index.php?topic=809
GuiTools - A graphic UI framework (can do multiple UI forms/windows in one program)
Libraries - ImageProcess, StringBuffers (virt. files), MD5/SHA2-Hash, LZW etc.
Bonus - Blankers, QB64/Notepad++ setup pack

Offline Ryster

  • Newbie
  • Posts: 77
    • View Profile
Re: Error in code
« Reply #2 on: March 10, 2019, 10:28:14 am »
Thank you very much.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Error in code
« Reply #3 on: March 10, 2019, 02:12:30 pm »
Hi
as RhoSigma says name already in use on line.... is the feedback that QB64ide gives
Programming isn't difficult, only it's  consuming time and coffee

Offline Ryster

  • Newbie
  • Posts: 77
    • View Profile
Re: Error in code
« Reply #4 on: March 11, 2019, 05:27:05 pm »
Reading and understanding are two different things. In addition, how to use a translator.
Regards.