Main Menu

Input Statement

Started by moonlightembrace, March 15, 2006, 07:15:59 AM

Previous topic - Next topic

moonlightembrace

Where is the input statment in PlayBasic? I'd like to write old style text games for tutorials, but PB doesn't seem to have one. Am I missing it somewhere?

-ME

kevin

It's not native, but there are various custom placements. From your ide, select open, then go to  Projects/Examples/Input.

moonlightembrace

#2
It, or something like it, should be native. Alot of people who know BASIC are going to be turned off when they try it, fail, check the manual, and find out it doesn't even exist. Also, it's really hard to tell noobs, "Ok, now stick this very large (to you) and complex (to you) function in your code. Now we're going to teach you the basics....". Thirdly, without an INPUT statement, you're throwing away 30 years of games that noobs CAN write and understand.

Thank you for the space to rant.

-ME

Ian Price

Whilst I think input should be included for those that may want it, it isn't really as important as you make it out to be. Anyone programming for even a short time will probably not use the command, as it's easily possible to create words and such simply using strings and arrays etc.

Don't let the lack of one command put you off a whole language- there are alternatives. If you can't do whatever it is you want without certain commands, then just yell - you'll probably get a working solution within an hour or so.
I came. I saw. I played some Nintendo.

moonlightembrace

QuoteWhilst I think input should be included for those that may want it, it isn't really as important as you make it out to be. Anyone programming for even a short time will probably not use the command, as it's easily possible to create words and such simply using strings and arrays etc.

I don't need an input statement. Noobs do. One of the problems with PlayBasic is that its not noob friendly. Noobs need to be able to start out using the basic few expermental lines you will find in any BASIC book for beginners. (which requires an input statement). Even people learning C++ need cin and cout.

QuoteDon't let the lack of one command put you off a whole language- there are alternatives. If you can't do whatever it is you want without certain commands, then just yell - you'll probably get a working solution within an hour or so.

But a noob won't. A noob will just throw up his hands and say "I don't get all this programming stuff".

-ME

P.S. I should state that I would really like to see PlayBasic become noob friendly so it becomes more popular. I really, really like the IDE. It's first class and really thought out. :)

Ian Price

#5
Actually, not one Noob has requested the Input command that I'm aware of. Nobody else has either. Like I said, it would be useful to have it, but not essential.

PlayBASIC is no less Noob friendly than BlitzBASIC or PureBASIC etc.

PB hasn't got a really big userbase, but what it does have is usually able to offer friendly and personal assistance quickly. OK, at the moment there aren't that many tutorials, but there are enough to get you going with pretty much any type of game you want to write. Indeed, the author of PB answered your question within 20 minutes of asking.

The tutorials and examples that came with PB are certainly enough to get an experienced coder up and running quickly. I wrote JetPakPB in less than 8 weeks and it was only my second PB game (after a testing ground version of Space Invaders). Admittedly, I have been programming for a while (20+ years), but experience allowed me to take what I had learned in other languages and use it in PB.

If you are not a Noob, then why exactly are you worrying about a Noob's thoughts of PB?

The demos that came with PB certainly impressed me and I'm well past being a Noob. You have to remember that PB also offers lots of stuff that other similar BASIC style packages don't offer, including real-time scaling, rotation, alphaing, Z ordering, time based management to mention just a few. In my opinion, these are much more important than Input.

Remember that PlayBASIC isn't BASIC. Any books that relate purely to BASIC, will not include anything like the programming skills required for any of the XXXXBASIC softwares on the market now.
I came. I saw. I played some Nintendo.

moonlightembrace

QuoteActually, not one Noob has requested the Input command that I'm aware of. Nobody else has either. Like I said, it would be useful to have it, but not essential.

Chances are someone who has never programmed before doesn't even know that Input exists. Its easy to forget what it was like before you know what you know now.

QuotePlayBASIC is no less Noob friendly than BlitzBASIC or PureBASIC etc.

BlitzPlus :

name$=Input$("What is your name?")

PureBasic :

name$=Input()

QuotePB hasn't got a really big userbase, but what it does have is usually able to offer friendly and personal assistance quickly. OK, at the moment there aren't that many tutorials, but there are enough to get you going with pretty much any type of game you want to write. Indeed, the author of PB answered your question within 20 minutes of asking.

The tutorials and examples that came with PB are certainly enough to get an experienced coder up and running quickly. I wrote JetPakPB in less than 8 weeks and it was only my second PB game (after a testing ground version of Space Invaders). Admittedly, I have been programming for a while (20+ years), but experience allowed me to take what I had learned in other languages and use it in PB.

Experienced coders? I think that's a part of the problem. Why would an experienced coder pay $35 for PlayBasic when he can use freeBASIC and Allegro (which it supports natively) for free? Noobs are what create a userbase. Then, noobs become experienced coders, who help the noobs, who become experienced coders, who help the noobs...

QuoteIf you are not a Noob, then why exactly are you worrying about a Noob's thoughts of PB?

My first computer was a Vic 20. :)

As to why I asking about the noob friendlyness of PB is that I write open source information for a living. I love the PB IDE and wanted to start an open source PB site.

QuoteThe demos that came with PB certainly impressed me and I'm well past being a Noob. You have to remember that PB also offers lots of stuff that other similar BASIC style packages don't offer, including real-time scaling, rotation, alphaing, Z ordering, time based management to mention just a few. In my opinion, these are much more important than Input.

I like the demos too. But they amount to nothing more than the screensaver that shows off a new 3D card. Not very educational.

QuoteRemember that PlayBASIC isn't BASIC. Any books that relate purely to BASIC, will not include anything like the programming skills required for any of the XXXXBASIC softwares on the market now.

Programming is a generalized skill. You can take what you learn in BASIC and apply it to C++. You can apply concepts learned in text games to RPGs.  I can't imagine anyone creating a 3D game without a FOR...NEXT loop.

-ME

Ian Price

#7
QuoteBlitzPlus : name$=Input$("What is your name?")

PureBasic: name$=Input()

Having an Input function doesn't make them any more user-friendly. And neither Blitz or PureBASIC offer real-time scaling and rotation.

Who says experienced coders won't buy PB? I did. I've written well over 100 games since owning an Amstrad CPC in 1984 in languages from BASIC, GAC, AMOS, AMOS Pro, TGF, Div Games Studio, C, C++, Fenix, BlitzBASIC, Blitz3D, BlitzMax and I've just grabbed a copy of PureBASIC too.

Allegro isn't exactly Noob friendly now is it? - compiling it to run in the first place is a very hit and miss affair, something that a Noob wouldn't understand. Then you have to tackle C, which again isn't exactly Noob friendly. Sure there are books out there, but you're not going to advance as quickly even with them as you would in PB.

Like I said, PB isn't BASIC and trying to compare it like for like, PB would win every time.

Throwing your toys out of the pram just because a fledgling language doesn't offer something that another does is pointless. You've already made up your mind that you don't like PB.
I came. I saw. I played some Nintendo.

moonlightembrace

QuoteHaving an Input function doesn't make them any more user-friendly. And neither Blitz or PureBASIC offer real-time scaling and rotation.

If a noob can't grasp the basics of programming, it doesn't matter if any language has a built-in function for sprite scaling. Also see the comment about noobs making a userbase above.

QuoteWho says experienced coders won't buy PB? I did. I've written well over 100 games since owning an Amstrad CPC in 1984 in languages from BASIC, GAC, AMOS, AMOS Pro, TGF, Div Games Studio, C, C++, Fenix, BlitzBASIC, Blitz3D, BlitzMax and I've just grabbed a copy of PureBASIC too.

I'm not getting into a pissing contest.

QuoteAllegro isn't exactly Noob friendly now is it? - compiling it to run in the first place is a very hit and miss affair, something that a Noob wouldn't understand. Then you have to tackle C, which again isn't exactly Noob friendly. Sure there are books out there, but you're not going to advance as quickly even with them as you would in PB.

My comments about freeBASIC and Allegro were aimed only at experienced programmers. Secondly, a noob CAN handle compiling in freeBASIC with the FBIDE. freeBASIC also supports core BASIC.

QuoteLike I said, PB isn't BASIC and trying to compare it like for like, PB would win every time.

I'm not getting into a Coke / Pepsi style loyalty war.

QuoteThrowing your toys out of the pram just because a fledgling language doesn't offer something that another does is pointless. You've already made up your mind that you don't like PB.

On the contrary, I like PB. Just the PBIDE alone is worth using it.  LOL, if I didn't like PB, I would be making a freeBASIC open source site right now.

-ME

Tracy

As a newb, I have no idea what Input() means or is used for or anything else- and I've therefore never missed it and get along just fine. The PB learning curve is stellar, in my opinion, and I've really enjoyed learning to program with it. Grasping the language took a bit (and is an ongoing process) but the help menus were great and very clearly written.

I'm a *happy* PB newb. And it was worth every cent of the $35.  :D

(Not intended as an incitatory comment, ME. I actually really enjoyed you and Ian's dialogue, but thought I'd throw in my 2c. :))

JokerZ

QuoteWhere is the input statment in PlayBasic? I'd like to write old style text games for tutorials, but PB doesn't seem to have one. Am I missing it somewhere?

I think one of the things to look at (or at least survey for), is why people are looking at playbasic.  Many of them (potentially) would be looking at the language as a way to handle an idea or concept they have for running 2D graphics.

The language is geared towards a graphical 2D environment, thats my take on it after reading the forums here for the last 12+ months. Its also what I've used it for when programming a few concepts for some games I want to eventually sit down and write.

Now the input statement might be your holy crusade, but in the overall scope of things it might not be the best place to aim an initial tutorial. People who are attracted to playbasic might be a lot more interested in moving a sprite around on the screen or building a workable map for a 2D platform game, you know, something of that nature.  

If you really want to provide a tutorial on input. Write a function that shows how to build your own input routine. In my opinion vastly more useful that printing a few simple lines of text as you've got in another post. Certainly not a difficult task for someone who has thrown together code before. You never want the learning experience of a tutorial to be so dumbed down as for it to appear to be worthless or to even appear condescening to someone who wants to learn to use the language.
I'm responding to all of your posts via this one thread, rather than spamming around to the various others you have posted on the pb forums.

robby

...another newbie looking for a conventional INPUT statement!

just my 2 cents though.....

kevin

There are two rather obvious issues that make implementing a traditional input untenable..

1) PB uses a double buffered display.   Some video cards won't allow front buffer access.  

2) Input is not asynchronous.



  Using the existing PB Input lib you can tweak how input works.




; Include the Input Library
  #Include "input"

t$=SimpleInput(100,100)
print t$


sync
waitnokey
waitkey


Function SimpleInput(xpos,ypos)
 MyInput =NewInput(xpos,ypos,"")
 InputColours(MyInput, getink(),RGB(0,0,255))
 repeat
 cls 0
 Input(MyInput)
 Sync  
 until GetInputActive(MyInput)=false
t$=getInputText(MyInput)
DeleteInput(MyInput)
Endfunction t$

flockhound

I think this is the only thing I really don't like about PB...hmm...

thaaks

For me the INPUT command is the only command I never thought about while using PB   :D.
For programming games I would never choose some blocking input method. I was happy when I saw that I could handle everything asynchronously.

I do understand that BASIC beginners would love to have that for simple programs like

print "Please enter your name:"
input name$
print "Hello " + name$ +", nice to meet you!"


But if you want to implement anything else than old Infocom style text adventures (Hitchhiker's guide to the galaxy, anyone?) you really don't need an INPUT command but want to use the Input library PlayBasic provides.
This way you can read input (words, lines) from the keyboard and update stuff in the background (moving stars, menu items, sprites whirling around, whatever) at the same time. The old INPUT just blocks everything. Bah.

Old Basic examples would never work in PB anyway because you always have to add

sync
waitkey
lines everywhere to force screen redraws and pauses to allow the user to see something.

Sometimes it just doesn't make sense to try to be backward compatible  :(