The idea stems from the internet forum phenomenon where forum goers submit tidbits based on rules provided in the initial post. This, combined in a programming forum would be a great source of learning and the opportunity to be apart of a nifty community project!
Rules and Regulations:
- 1] Each user is limited 10 lines of code of unlimited length. You may make additional code submissions after two other users have contributed their code after yours. You do not have to use all 10 lines of code per submission.
2] Each line should not contain more than one line separation(ex S$="yes" : B$="no"). This does not count against your 10 lines. Comments do not count as lines.
3] All PureBasic functions, keywords etc are allowed(Even Ogre).
4] Please comment code, since this is project is to learn from each other why leave your code without comments?
5] No libraries or includes are allowed.
6] You may change, edit and improve upon(or correct) a previous posters code submission for your "turn". Each line change/removed counts as one of your lines.
7] Whenever you post a submission, you must post your code with the above posters code. So we don't have any rogue coders running lose!
8] And finally, the project must compile after each new code submission! As long as the project compiles, then your code qualifies! Other users may finish your code, or you may finish it once you're able to post again!
Now, to get it started!
Code: Select all
;*********************************************
; PureBasic Community: Evolving code
; January 26, 2010
;*********************************************
Enumeration
#MainWindow = 0
#TextGadgetOne
EndEnumeration
iWidth.l=300 : iHeight.l=200 ; Maybe someone can think up something cool to do with this :)
OpenWindow(#MainWindow,0,0,iWidth,iHeight,"PB Community: Evolving code",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
TextGadget(#TextGadgetOne,70,85,200,20,"The PureBasic Community rocks!") ; It's true!
Repeat
EventID = WaitWindowEvent(20)
Until EventID = #PB_Event_CloseWindow