Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Dragoncat

Pages: [1]
1
Programs / Re: Calculating Pi
« on: May 08, 2019, 07:33:30 pm »
ok thanks a lot....

2
what if I read the executable in with another program, add the needed date to the program which is designed to look for it, and voila! that might work? IE edit the program with another program as if it was a just a file on the computer... then next time that program runs as in actually runs then it should be able to read those bytes you just added, but if you mess up on that adding part and accidentally run the program before you make the necessary modifications that could be very bad...also you should make the program to be sure it will end at it's end by using a system or end or exit command so it does not run the data that you added or will add at the end of the actual program..!!! failure to do so might be bad.

3
Programs / Re: Calculating Pi
« on: May 08, 2019, 12:03:04 pm »
YEs thanks that program for calculating pi uses the Gauss-Legendre algorith  also known as Gauss - Euler or Brent-Salamin or Salamin-brent (named after the inventors who came up with this method)  with this algorythm pi was calculated to 206,158,430,000 decimal places and the results were checked with Borwein's algorithm, (sept 18 - 20 1999 was when the calculation took place.)  awesome ha??

4
Is it possible to create a program that has a string or value in it that it saves with the program itself that changes every time the program is run?? as in it saves it IN THE PROGRAM ITSELF after the executable part of the code, and then can change it every time it is run, I have some ideas for using this kind of functionality, also the program should not ever actually run on over or whatever the part that it changes, and should be invisibly attached to the program itself, and not as a separate file... can this be done?... like I was thinking maybe have some data attached to the end / at the end of the program  after the program is compiled to an EXE that the program would then be able to look for and find, by scaning to the end of the program then rewinding by a certain number of bytes, as the data added would be a specific number of bytes long like say 32 bytes... can this be done??

5
Programs / Re: Calculating Pi
« on: May 08, 2019, 11:37:10 am »
oh the invalid name problem was fixed, it was that I was trying to pass an argument where the program was not expecting an argument to be passed, I hope it did not "break" the program.. it is a very delicate random number generator.

6
Thanks a lot !!! It must have added that sometime later as some sort of a glitch that happened, program works fine now!!, give it a try..It does need the added functionality of letter the user look for and browse files and choose a file to encrypt / decrypt etc... but it is a fine start! thanks for fixing the problem , I would have never guessed that it was an argument thing like that, I wonder if the argument was needed for the program to work correctly or not, I will have to review my programs inner workings, flow chart it have tests done for randomness etc... lot of work still needs to be done, but thanks!!!, thanks a lot!!

7
Programs / Re: Calculating Pi
« on: May 08, 2019, 11:00:59 am »
I tried looking at that it hurt my eyes.. it is overly complicated, isn't there a simpler way of using really big high precision numbers??
I need a much simpler way.. something like BigNumAdd$(a$,b$) where a$ and b$ are strings that represent NUMBERS and that can INCLUDE a decimal point and  / or a SIGN (-) isn't there something like that in Qbasic? there should be all the math functions built in to QB64 like this it would make life so much easier for us all, native big decimal support in native Qbasic, what a NOVEL IDEA THAT WOULD BE HA?? ALSO please fix/restore the ability to have subroutine programs without us getting "invalid name" errors PLEASE!!

8
Programs / Re: Calculating Pi
« on: May 07, 2019, 09:57:08 pm »
what I need is quadruple 256 bit floating point precision math support in qb64... that would make things simpler for me... in other words to support a 256 floating point number, I know that's a lot of bytes for a number, but I think it would be great for mathematical accuracy and all...

9
DECLARE SUB Rndmiz ()
DECLARE FUNCTION Grand! ()
DIM SHARED Pad1$(15), Pad2$(15), ToByte(63), ToB64(255), Mods(12)
COMMON SHARED L0, L1, L2, L3, ToB64(), L5, ToByte(), L7, Mods(), L9, L10$
COMMON SHARED L11$, L13$, I14, I15, I17, L20, Pad1$(), Pad2$(), L26$, L28$, I29
COMMON SHARED I34, L35, L36, L37$, I38, I39, L40!, I42, Modder2, L44, L45
COMMON SHARED L46, Modder, I50, L51$, L54
L0 = 0
L3 = 255
L1 = 1
L5 = 63
L7 = 12
Modder = 64
Modder2 = 256
110 RANDOMIZE TIMER
120 FOR L2 = L0 TO L3 STEP L1
    130 ToB64(INT(L2)) = -1
140 NEXT
150 FOR L2 = L0 TO L5 STEP L1
    160 READ ToByte(INT(L2))
    170 ToB64(ToByte(INT(L2))) = INT(L2)
180 NEXT
190 FOR L2 = L0 TO L7 STEP L1
    200 READ Mods(INT(L2))
210 NEXT
220 L9 = L0
222 SHELL "dir *.* /w /p"
390 INPUT "enter file to encrypt/decrypt"; L26$
400 INPUT "enter name of output file"; L28$
INPUT "enter seed (password)"; L13$
I14 = LEN(L13$)
IF I15 <= 15 THEN GOTO set2max
L13$ = LEFT$(L13$, 15)
set2max: I17 = 15
FOR L2 = L0 TO 15 STEP L1
    PRINT "("; L2; ") ";
    Pad1$(INT(L2)) = LEFT$(L13$, 1)
    L13$ = RIGHT$(L13$, I17)
    Pad2$(INT(L2)) = Pad1$(INT(L2))
    I17 = I17 - 1
NEXT
430 OPEN L26$ FOR BINARY AS #1
440 OPEN L28$ FOR BINARY AS #2
450 I34 = LOF(1)
REM 460 L35 =  'L35 apparently is not being used...
470 L36 = I34
480 GOTO 600
490 CALL Rndmiz
495 L40! = Grand!
peel& = 32
IF I34 < 32 THEN peel& = I34
510 L37$ = STRING$(peel&, 32)
520 GET #1, I39, L37$
strlen = LEN(L37$)
FOR sloc = 1 TO strlen
    CALL Rndmiz
    L40! = Grand!
    530 IR12 = INT(L40! / 256) '( # Top half of long integer # )
    540 IR14 = (INT(L40! * 256)) MOD 256
    IF sloc <= LEN(L37$) THEN
        bite$ = MID$(L37$, sloc, 1)
        550 I42 = ASC(bite$) XOR IR14
        560 L37$ = CHR$(I42 MOD Modder2)
    END IF
NEXT sloc
570 PUT #2, I39, L37$
580 IF I29 <> 1 THEN GOTO 600
590 PRINT L37$;
600 I39 = I39 + 1
610 I38 = I38 + 1
620 IF I39 <= L36 THEN GOTO 490
630 CLOSE #2
640 CLOSE #1
650 SYSTEM
870 DATA 32,33,34,35,36,37,38,39
880 DATA 40,41,42,43,44,45,46,47
890 DATA 48,49,50,51,52,53,54,55
900 DATA 56,57,58,59,60,61,62,63
910 DATA 64,65,66,67,68,69,70,71
920 DATA 72,73,74,75,76,77,78,79
930 DATA 80,81,82,83,84,85,86,87
940 DATA 88,89,90,91,92,93,94,95
950 DATA 2,3,5,7,11,13,17,19,23,27,33,37,43
960 END

FUNCTION Grand!
    L40! = 0!
    L54 = .015625
    FOR L2 = 13 TO 15 STEP L1
        L40! = (ASC((Pad1$(INT(L2)))) - 32) * L54 + L40!
        L54 = L54 / 64
    NEXT
    Grand! = L40!
END FUNCTION

SUB Rndmiz
    L45 = Mods(INT(L9))
    FOR L46 = 0 TO 3 STEP 1
        FOR L2 = 0 TO 15 STEP 1
            IF (L2 MOD 2) <> 0 THEN GOTO skp1
            L45 = (ASC((Pad1$(INT(L2)))) + -32) + L45
            skp1: IF (L2 MOD 2) <> 1 THEN GOTO skp2
            L45 = (-(ASC((Pad1$(INT(L2)))) - 95)) + L45
            skp2: IF L2 <= L0 THEN GOTO bland01
            Pad1$(INT(L2 - 1)) = Pad1$(INT(L2))
        bland01: NEXT
        I50 = L45 MOD Modder
        L51$ = CHR$(ToByte(I50))
        L9 = (L9 + L1) MOD 13
    NEXT
END SUB

this does not seem to work in the latest version of  QB64 I get the message Invalid name on line 96 what is wrong??
There Removed (45 pad$...) on line 96 and the program works FINE!! feel free to copy it and try it out!! Ill be making som minor improvements to it eventually, like having it give you a list of available files, thus letting you more easily select a file etc...

10
Programs / Calculating Pi
« on: May 07, 2019, 08:58:28 pm »
a# = 1
b# = 1 / (2 ^ .5)
t# = 1 / 4
p# = 1
FOR l = 0 TO 9
    s# = (a# + b#) / 2
    u# = (a# * b#) ^ .5
    v# = t# - p# * (a# - s#) ^ 2
    p# = 2 * p#
    a# = s#
    b# = u#
    t# = v#
    f# = ((a# + b#) ^ 2) / (4 * t#)
    PRINT f#
NEXT l
the above program generates the value of Pi to the maximum precision of double precision numbers in just 3 iterations... is there any way you can have a value that you can add multiply and raise to a power or root or divide etc that would have more precision, like say 2X the precision or perhaps even an ungodly 10X or 1000X the precision that can be easily implimented? what can I say I am obsessed with precision... thanks in advance.

Pages: [1]