Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Julia Pattern
#1
Can anyone suggest why the following works perfect with QB, but fails to
display full screen with FB windows ver. 1.2, and the first screen fails to
close. It is also impossible to use INPUT with the SCREEN 9.

Gordon
Code:
DEFSNG A-Z
     REM based on orignal BBC Magazine Beebug May 1989 Vol 8 No. 1
     COLOR 11, 4: LOCATE 7, 25: PRINT " Julia Patterns ": PRINT : COLOR 13, 0
     PRINT : PRINT
     IF OK = 1 THEN
          INPUT "           Enter Y to start new pattern, or N to quit"; Q$
          IF Q$ <> "Y" AND Q$ <> "y" THEN END
     END IF
     PRINT TAB(10); : INPUT "Enter the Real value, say 1 to -1 including
decimals"; G
     PRINT TAB(10); : INPUT "Enter the Imaginary value, say 1 to -1 including decimals"; H
     SCREEN 9
     XZ = .005: YZ = .004: MC% = 200: WINDOW (-520, -520)-(750, 520)
     LOCATE 6, 72: PRINT "REAL:": LOCATE 7, 70: PRINT USING "##.#####"; G
     LOCATE 9, 70: PRINT "IMAGINARY:": LOCATE 10, 70: PRINT USING "##.#####"; H
     FOR X = -1.408 TO 0 STEP XZ
          FOR Y = -1.408 TO 1.408 STEP YZ
          R = X: I = Y: C% = 0
          FIN = 0
          WHILE FIN = 0
               N = R * R - I * I + G: M = 2 * R * I + H
               C% = C% + 1: S = R * R + I * I
               R = N: I = M
               IF S > 4 OR C% > MC% - 1 THEN FIN = 1
          WEND
          IF C% > MC% - 1 OR C > 25 THEN P% = 15
          P% = C% + 5
          X% = 364 * X: Y% = 364 * Y
          PSET (X%, Y%), P%
          PSET (-X%, -Y%), P%
          NEXT Y
     NEXT X
     SLEEP : END
Reply
#2
Works just fine here - the "first screen" is the console, so it won't close when you set a graphics mode. You can get a fullscreen graphics mode by passing &H1 as the third parameter to SCREEN. (See the documentation at http://www.freebasic.net/wiki/wikka.php?...engraphics for more information). Also you could just drop a SCREEN 9 in the beginning of the program to make everything graphical and avoid the "first screen won't close" dilemma. INPUT works just fine with SCREEN 9, too.

Which version of FreeBASIC are you using? (Do 'fbc -version'.) The target platform you are using is also helpful to know (the win32 compiler isn't the only one Smile ).

HTH
Reply
#3
Thanks,

I will experiment.

Have a look at below in case you find something of interest

http://sionet.mysite.wanadoo-members.co.uk/npage4.html

Gordon
Reply
#4
I had to move the input lines down on their own lines and then it worked correctly.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)