Ooops
November 28, 2020, 11:12:12 AM

Author Topic: [bmx] Grid by jankupila [ 1+ years ago ]  (Read 796 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bmx] Grid by jankupila [ 1+ years ago ]
« on: June 29, 2017, 12:28:43 AM »
Title : Grid
Author : jankupila
Posted : 1+ years ago

Description : Grid

Code :
Code: BlitzMax
  1. Strict
  2.  
  3. Graphics 1024,768
  4.  
  5. Type cells
  6.         Field x
  7.         Field y
  8.         Method piirra()
  9.                 SetColor 255,2552,255
  10.                 DrawLine x,y,x,y+20
  11.                 DrawLine x,y,x+20,y
  12.                 SetColor 80,80,80
  13.                 DrawLine x+20,y,x+20,y+20
  14.                 DrawLine x,y+20,x+20,y+20
  15.                 DrawRect x+1,y+1,18,18
  16.         End Method
  17. End Type
  18.  
  19.  
  20.  
  21. Local cell:cells=New cells
  22.  
  23. For Local t=100 To 924 Step 22
  24.         For Local i=100 To 668 Step 22
  25.                 cell.x=t
  26.                 cell.y=i
  27.                 cell.piirra()
  28.         Next
  29. Next
  30.  
  31. Flip
  32.  
  33. WaitKey


Comments :


_Skully(Posted 1+ years ago)

 Posts like this do nothing but clutter the code archives with junk.


jankupila(Posted 1+ years ago)

 What's wrong with that? I will do it better if you say how.


TaskMaster(Posted 1+ years ago)

 Yep.  There is even a bug...


TaskMaster(Posted 1+ years ago)

 What he means by "clutter the code archives" is that this piece of code is way too basic to be here.The code archives is for useful code.  This should be posted in the beginners section, if anywhere.


jankupila(Posted 1+ years ago)

 Ok thanks. By the way, I didnt find the bug.


Jesse(Posted 1+ years ago)

 I like it I. I think it's creative. I do think it could be useful for somebody even as simple as it is. a beginner might find it usefull.One thing I disagree is with the code formatting. I think code submitted to the code archives should have mandatory indentation and the code should be  in 'Strict' mode.


jankupila(Posted 1+ years ago)

 I edited the code.I made intendations and I changed it to 'strict' mode.


_Skully(Posted 1+ years ago)

 
Code: [Select]
Strict
Graphics 1024,768
For Local x=100 To 924 Step 22
For Local y=100 To 668 Step 22
SetColor 255,252,255
DrawLine x,y,x,y+20
DrawLine x,y,x+20,y
SetColor 80,80,80
DrawLine x+20,y,x+20,y+20
DrawLine x,y+20,x+20,y+20
DrawRect x+1,y+1,18,18
Next
Next
Flip
WaitKey



puki(Posted 1+ years ago)

 Personally, I prefer the Blitz3D version:
Code: [Select]
Graphics 1024,768,0,2
For x=100 To 924 Step 22
    For y=100 To 668 Step 22
        Color 255,255,255
        Line x,y,x,y+20
        Line x,y,x+20,y
        Color 80,80,80
        Line x+20,y,x+20,y+20
        Line x,y+20,x+20,y+20
        Rect x+1,y+1,18,18,0
    Next
Next
Flip
WaitKey()End
It's less strict.Edited out "_Skully's" '2552' error.


puki(Posted 1+ years ago)

 This is a bit more exciting:
Code: [Select]
SeedRnd MilliSecs()
Graphics 1024,768,0,2
For x=100 To 924 Step 22
    For y=100 To 668 Step 22
        Color Rand(1,255),Rand(1,255),Rand(1,255)
        Line x,y,x,y+20
        Line x,y,x+20,y
        Color Rand(1,255),Rand(1,255),Rand(1,255)
        Line x+20,y,x+20,y+20
        Line x,y+20,x+20,y+20
        Rect x+1,y+1,18,18,1
    Next
Next
Flip
WaitKey()
End
Blitz3D only.Looks a bit like mosaic flooring.Or even:
Code: [Select]
SeedRnd MilliSecs()
Graphics 1024,768,0,2
Repeat
For x=100 To 924 Step 22
    For y=100 To 668 Step 22
        Color Rand(1,255),Rand(1,255),Rand(1,255)
        Line x,y,x,y+20
        Line x,y,x+20,y
        Color Rand(1,255),Rand(1,255),Rand(1,255)
        Line x+20,y,x+20,y+20
        Line x,y+20,x+20,y+20
        Rect x+1,y+1,18,18,1
    Next
Next
Flip
Until KeyHit(1)
End



Who was John Galt?(Posted 1+ years ago)

 Wow, it may be a little on the simple side for the code archives, but you lot are being somewhat harsh. Not everyone is an uber programmer, you know. Nor do they have to be.


Jesse(Posted 1+ years ago)

 true, The code archives are not only for exceptionally talented programmers like puki and _Skully...Or did I missed something in the rules?


puki(Posted 1+ years ago)

 I never put him down - I just added a Blitz3D one, then sort of played with it out of interest.  I made a few more, but didn't post them.


TaskMaster(Posted 1+ years ago)

 I do not know what the "rules" are.  But, we could easily fill the code archives section with little snippets of code that anybody could write.I don't feel that it is the purpose of the code archives.  Maybe it is, I do not know.  I just know that when I look through the code archive, I am looking for something useful, that I could not whip up myself in 2 minutes.If the general consensus is that the code archives should be used for very basic stuff, then so be it.  It is not my code archives to manage.  I retract my previous statement.


Jesse(Posted 1+ years ago)

 the code archives is proportionally useful to the skill level of the programmer  in need of something here. A beginner user will find the code quite useful even 1 line code. The problem is that as soon as we start to improve our skills we begin to find even our own old code embarrassing to share and while we can now look at our old code and say that it is too stupid to look at much less share, I looked at the first few pages code archives' and learnt they are full of examples with similar code posts yet no one complained. The thing is that the more skilled we become the less useful we find the code archives to be and we look at code like this as an insult to our intelligence but we are not being open minded about beginners. Bottom line is that this issue should be addressed by BRL but at last it seems we are beating on a dead horse. Technology and society changes but everything here seems to remain frozen in time.


Andy_A(Posted 1+ years ago)

 In addition to what Jesse said, while Blitz2D, Blitz+, and Blitz3D are aging products, they are still new languages to those who just purchased a Blitz product.The code archives are not only for the 'veteran' Blitz programmer but for 'noobs' as well. When I first purchased BlitzPlus, the code archives were the best examples of how to get things working, especially since the Blitz manuals are not the most lucidly written manuals ever produced (that's why I haven't splurged for Bmax).For those individuals who think the simple program snippets are beneath them, I would suggest they make their own 'superior' contributions and leave all others in awe of their 'leetness'.Nobody starts out as an expert, at some point in our lives we all started out as a 'noob'.


Who was John Galt?(Posted 1+ years ago)

 I think the ideal answer would be to have a 'simple' or 'beginner' section in the archives, that way everyone can contribute and benefit.


Axel Wheeler(Posted 1+ years ago)

 I think the answer is that it should be useful to someone, including beginners.  But in order for that to happen there has to be some description of why it might be useful; that's what's really missing here.  The author of any item in the code archives should include a description of what the code does and why it might be useful to someone.  I suspect if Jankupila had done that skully and taskmaster wouldn't have had a problem with it.So, Jankupila, keep going; just be sure to include a little write-up.


_Skully(Posted 1+ years ago)

 how about three buttons that act like votes[beginner] [intermediate] [advanced]then they will sort themselves


_Skully(Posted 1+ years ago)

 Double post {snip}


Jesse(Posted 1+ years ago)

 and How about a vote system that if the code does not get any votes with in a six month period gets deleted or gets dumped in to a useless bin/section? or a vote to determine if it gets deleted or not?


_Skully(Posted 1+ years ago)

 How about[Delete it, its crap] [beginner] [intermediate] [advanced]Don't get me wrong I'm all for having beginner stuff, but when you are looking for valuable code and don't have a search function its essential to keep things relevant and meaningful.


TaskMaster(Posted 1+ years ago)

 There is a beginners area in the forums already.Code snippets like this belong there.  Not really useful other than a learning tool for a very very beginner.


Jesse(Posted 1+ years ago)

 <div class="quote"> There is a beginners area in the forums already </div>That is just as relevant as saying "there is a programming section in the forum already". Why post anything here?


Yasha(Posted 1+ years ago)

 <div class="quote"> when you are looking for valuable code and don't have a search function </div>I have no idea why it was put in Blitz3D programming, but:  <a href="../Community/postsb380.html?topic=88773" target="_blank">http://www.blitzbasic.com/Community/posts.php?topic=88773[/url]Really ought to be in the toolbox...


_Skully(Posted 1+ years ago)

 I wasnt saying that you cant search by other means... you can isolate google to a site for example, but its not built into the archive. [/i]

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal