1. New prog!
- Posted by Matthew A Nunyabidness <matt1421 at JUNO.COM> Sep 17, 1998
- 586 views
- Last edited Sep 18, 1998
I wrote a color band program in Euphoria and QuickBASIC(just a comparison). See for yourself the speed: band.ex: include graphics.e --include graphics file include get.e integer smode --declare smode smode=graphics_mode(19) --equal to mode 13 in QuickBASIC for a=0 to 256 do pixel(a,{a,0}) pixel(a,{a,1}) pixel(a,{a,2}) pixel(a,{a,3}) pixel(a,{a,4}) pixel(a,{a,5}) pixel(a,{a,6}) pixel(a,{a,7}) pixel(a,{a,8}) pixel(a,{a,9}) pixel(a,{a,10}) pixel(a,{a,11}) pixel(a,{a,12}) pixel(a,{a,13}) end for puts(1,"\n\nThe color band, by matt1278 at juno.com") puts(1,"\nEnjoy!") if smode then end if puts(1,"\nHit any key") object wkey wkey=wait_key() if wkey then end if smode=graphics_mode(-1) clear_screen() band.bas: CLS SCREEN 13 FOR a = 1 TO 256 FOR b = 1 TO 10 PSET (a, b), a NEXT b NEXT a LOCATE 3, 1 PRINT "The color band rewritten in QB 4.5" PRINT "Contact matt1278 at juno.com for questions and comments" PRINT "Hit any key" SLEEP SCREEN 0 WIDTH 80, 25 CLS Try it out! Band.ex is wwwwwwwaaaaaaayyyyyyyy faster. I bet it would be even s-l-o-w-e-r in QBasic. QBasic is slower than QuickBASIC. But I think the compiled version of band.bas(on my trusty disk here) is fast too. Try binding band.ex! If you think you can enhance it or something, email me. If you have any tips on how to make a screen mode in Euphoria or BASIC(256 colors, 640x480 graphics, 80x25 text), tell me!!!!!!!!!!!!! Screen 13 is the best I can get, but I want a finer resolution.
2. Re: New prog!
- Posted by Hawke <mdeland at NWINFO.NET> Sep 17, 1998
- 579 views
Matthew A Nunyabidness wrote: >I wrote a color band program in Euphoria and QuickBASIC(just a >comparison). See for yourself the speed: >Try it out! Band.ex is wwwwwwwaaaaaaayyyyyyyy faster. >I bet it would be even s-l-o-w-e-r in QBasic. 90% or more of us on the list, almost assuredly, program with Euphoria because Euphoria is simply *FAST*. *Fast* to write code with, *Fast* at runtime. The RDS crew,Rob most notably, flat outdid themselves. > puts(1,"\nHit any key") > object wkey > wkey=wait_key() > if wkey then > end if >If you think you can enhance it or something, email me. a much simpler way to do a 'waitkey' type affair: puts(1,"Press a key\n") if wait_key() then end if >Try binding band.ex! Unless I'm mistaken, you're impression of what binding does to a program written in Euphoria is a tad askew. Binding does not "compile" a .ex file. It is more of an appending, not a compiling. It simply puts the ex.exe and all of your programs' components (include files and your .ex) into one executable file. (well, it can do other more advanced things, but those things are mostly associated with "shrouding") This resulting exe file can be run by anyone else, without them having to have all those seperate include files, .ex files, and ex.exe all laying around. Binding can also be taken a step further, into shrouding, whereby the resulting .exe file that you distribute cannot be read easily. Your include files and .ex files, being straight text, can be easily read, and sometimes you want proprietary code to be just that, proprietary. Binding is only a method of simplifying distribution of your game/program/utility to those that aren't Euphoria programmers. On the listserv, for instance, we usually pass around .ex and include files, as we are all programmers here, and we all have ex.exe. We don't need to bind for distribution to each other, and it would eat bandwidth as well (all those 'extra' copies of ex.exe within all those bound files). If a program we create uses a bunch of includes, and a lengthy .ex, then we usually zip the includes & .ex for passing around via attachments. Hopefully, this clarifies any misconceptions you have about binding. Don't feel bad, many of us, myself most notably included, had similar misconceptions about binding. It also broke a lotta wishfull hopes when we found out we couldn't 'compile' :) (jus' pickin' on ya rob) >If you have any tips on how to make a screen mode in Euphoria or >BASIC(256 colors, 640x480 graphics, 80x25 text), tell me!!!!!!!!!!!!! >Screen 13 is the best I can get, but I want a finer resolution. wouldn't that depend on your monitor and video card? or do you mean that you have a razzledazzle video setup but don't know how to make Euphoria enter into higher modes? --Hawke' p.s. Welcome. You'll soon delete all copies of Basic on your HD, as did we all. :) (As I type this, I realized that on the bookshelf within view, there lies my old TurboBasic reference manual that hasn't been touched since downloading EUPH--heh)
3. Re: New prog!
- Posted by Hawke <mdeland at NWINFO.NET> Sep 17, 1998
- 538 views
- Last edited Sep 18, 1998
Matthew A Nunyabidness wrote: >I wrote a color band program in Euphoria ... >If you think you can enhance it or something, email me. >If you have any tips on how to make a screen mode in Euphoria or >BASIC(256 colors, 640x480 graphics, 80x25 text), tell me!!!!!!!!!!!!! >Screen 13 is the best I can get, but I want a finer resolution. try the following, a combination of improvement and autoselection of the best video mode based on your hardware and the program requirements. kills 2 birds with one bullet, i hope. -------------begin newband.ex (tested code) include graphics.e include get.e include select.e constant bestmode=257 --640x480x256, any higher and text too small constant fallback=19 --gotta have at least this --equal to mode 13 in QuickBASIC --autopick the best video mode --select_mode returns 0 if *failed* --graphics_mode returns 0 if *successful* if select_mode(bestmode) = 0 then --try the most wanted first if not graphics_mode(fallback) then --last ditch/last hope... puts(1,"Cannot find good graphics mode\n") abort(1) end if end if --MAIN for a=0 to 256 do for y=0 to 39 do pixel(a,{a,y}) end for end for puts(1,"\n\n\n\nThe color band, by matt1278 at juno.com") puts(1,"\nEnjoy!") puts(1,"\nHit any key\n") if wait_key() then end if --exit program if graphics_mode(-1) then end if clear_screen() --------------------------end newband.ex --Hawke'
4. Re: New prog!
- Posted by Matthew A Nunyabidness <matt1421 at JUNO.COM> Sep 18, 1998
- 529 views
On Thu, 17 Sep 1998 19:47:11 -0700 Hawke <mdeland at NWINFO.NET> writes: >Matthew A Nunyabidness wrote: >>I wrote a color band program in Euphoria and QuickBASIC(just a >>comparison). See for yourself the speed: >>Try it out! Band.ex is wwwwwwwaaaaaaayyyyyyyy faster. >>I bet it would be even s-l-o-w-e-r in QBasic. >90% or more of us on the list, almost assuredly, program with >Euphoria because Euphoria is simply *FAST*. >*Fast* to write code with, *Fast* at runtime. >The RDS crew,Rob most notably, flat outdid themselves. > >> puts(1,"\nHit any key") >> object wkey >> wkey=wait_key() >> if wkey then >> end if >>If you think you can enhance it or something, email me. >a much simpler way to do a 'waitkey' type affair: > puts(1,"Press a key\n") > if wait_key() then end if > > >>Try binding band.ex! >Unless I'm mistaken, you're impression of what binding >does to a program written in Euphoria is a tad askew. >Binding does not "compile" a .ex file. It is more >of an appending, not a compiling. It simply puts >the ex.exe and all of your programs' components >(include files and your .ex) into one executable >file. (well, it can do other more advanced things, >but those things are mostly associated with "shrouding") > >This resulting exe file can be run by anyone else, >without them having to have all those seperate include >files, .ex files, and ex.exe all laying around. > >Binding can also be taken a step further, into >shrouding, whereby the resulting .exe file that >you distribute cannot be read easily. Your include >files and .ex files, being straight text, can be easily >read, and sometimes you want proprietary code to be >just that, proprietary. > >Binding is only a method of simplifying distribution >of your game/program/utility to those that aren't >Euphoria programmers. On the listserv, for instance, >we usually pass around .ex and include files, as >we are all programmers here, and we all have ex.exe. >We don't need to bind for distribution to each other, >and it would eat bandwidth as well (all those 'extra' >copies of ex.exe within all those bound files). >If a program we create uses a bunch of includes, and >a lengthy .ex, then we usually zip the includes & >.ex for passing around via attachments. > >Hopefully, this clarifies any misconceptions you have >about binding. Don't feel bad, many of us, myself >most notably included, had similar misconceptions >about binding. > >It also broke a lotta wishfull hopes >when we found out we couldn't 'compile' :) >(jus' pickin' on ya rob) > >>If you have any tips on how to make a screen mode in Euphoria or >>BASIC(256 colors, 640x480 graphics, 80x25 text), tell me!!!!!!!!!!!!! >>Screen 13 is the best I can get, but I want a finer resolution. >wouldn't that depend on your monitor and video card? >or do you mean that you have a razzledazzle video setup >but don't know how to make Euphoria enter into higher modes? > > >--Hawke' >p.s. Welcome. You'll soon delete all copies of Basic on your >HD, as did we all. :) (As I type this, I realized that on the >bookshelf within view, there lies my old TurboBasic reference >manual that hasn't been touched since downloading EUPH--heh) > I said I compiled the BAS file, not the EX file. And I will NEVER delete my precious copy of QuickBASIC. _____________________________________________________________________ You don't need to buy Internet access to use free Internet e-mail. Get completely free e-mail from Juno at http://www.juno.com Or call Juno at (800) 654-JUNO [654-5866]
5. Re: New prog!
- Posted by Anybody A Nybody <anybody17 at JUNO.COM> Sep 18, 1998
- 546 views
Thanx for the tip, and i think that any higher than 257 IS too much. I tried mode 258, and there was white stuff at the top of my screen(which resembled "Hit any key"), and my monitor was making a weird whistling/buzzing sound. I've heard that software CAN damage hardware. O, an by the way. I found out my cheaper(i think it's cheper. there are screen modes in QuickBASIC that it doesnt support) Compaq monitor supports those SVGA modes! _____________________________________________________________________ You don't need to buy Internet access to use free Internet e-mail. Get completely free e-mail from Juno at http://www.juno.com Or call Juno at (800) 654-JUNO [654-5866]
6. Re: New prog!
- Posted by Anybody A Nybody <anybody17 at JUNO.COM> Sep 18, 1998
- 543 views
>_____________________________________________________________________ You don't need to buy Internet access to use free Internet e-mail. Get completely free e-mail from Juno at http://www.juno.com Or call Juno at (800) 654-JUNO [654-5866] < Juno changed it's website to http://home.juno.com. And now they make Juno gold and Juno web. Plain Juno doesn't support attatchments. _____________________________________________________________________ You don't need to buy Internet access to use free Internet e-mail. Get completely free e-mail from Juno at http://www.juno.com Or call Juno at (800) 654-JUNO [654-5866]
7. Re: New prog!
- Posted by Matt Z Nunyabidness <matt1421 at JUNO.COM> Sep 18, 1998
- 562 views
> puts(1,"Press a key\n") but that would start it on the same line, so: Enjoy! Hit any key Would be: Enjoy!Press any key I also found out position() doesn't work if your message text or something has \n in it. _____________________________________________________________________ You don't need to buy Internet access to use free Internet e-mail. Get completely free e-mail from Juno at http://www.juno.com Or call Juno at (800) 654-JUNO [654-5866]
8. Re: New prog!
- Posted by Hawke <mdeland at NWINFO.NET> Sep 18, 1998
- 558 views
Anybody A Nybody wrote: >and my monitor was making a weird >whistling/buzzing sound. that would be bad... not just a little bad either... >I've heard that software CAN damage hardware. yeah, it can... actually quite easily... force a monitor into an unsupported video mode, or too high a refresh rate, and of course there are virii... then if you go into asm/mach lang programming you can physically damage near about any part on your computer. is it easy to do the latter? no, so don't fret all that much about it... is it easy to damage a monitor? kinda, so take care with vid mode selections... --Hawke'
9. Re: New prog!
- Posted by Hawke <mdeland at NWINFO.NET> Sep 18, 1998
- 549 views
Matt Z Nunyabidness wrote: > > puts(1,"Press a key\n") > but that would start it on the same line it depends on the lines prior to that... it's simple enough to change it to puts(1,"\n Press a key \n") > I also found out position() doesn't work if your message text or > something has \n in it. I'm not sure what you are referring to here. If you use position and puts something with a \n, and then puts again, that next line will be underneath the first and at column 1. try this: clear_screen() position(5,10) puts(1,"textline 1\n") puts(1,"textline 2") the output will be: 12345678901234567890 1> 2> 3> 4> 5> textline 1 6>textline 2 where #> marks screen lines... If however, you used another position statement to place textline 2 onto the screen, then any \n encountered would be (of course) meaningless, since position will just... go to that point. Perhaps you could clarify your meaning? --Hawke