Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

minesweeper

Name: Anonymous 2008-07-10 7:06

i wanna make my own minesweeper game, using c#, how do i do the visual part, the button, if i use like 400 buttons it takes time to draw them all, how does the original game make the more than 500 buttons immediately?

Name: Anonymous 2008-07-10 7:11

Try using one control handling drawing, mouse and keyboard events yourself.

Name: Anonymous 2008-07-10 7:16

it's called a "loop"

gb2/cs101/

Name: Anonymous 2008-07-10 7:23

a loop? i use one to make the buttons.
but if i make like 144 buttons it takes a few second to draw them all,  the original game makes 667 in no time, how?
sorry if i misunderstood u, in that case can u explain a little bit more.

Name: Anonymous 2008-07-10 7:25

>>4
Oh wow. Read SICP.

Name: Anonymous 2008-07-10 7:46

>>4
Just paint your own buttons.

Name: Anonymous 2008-07-10 7:50

>>5
Yeah, I think chapter 5 is the one that covers minesweeper.

Name: Anonymous 2008-07-10 8:08

I have no experience with c#, but your problem is most probably  this:
It takes time to create buttons, not show them. Create one element that will hold all your buttons, make it invisible, create all your buttons on it (not on form), and then show this element.
Original minesweeper uses RAW winapi and has no relation to what you're doing whatsoever.

Name: Anonymous 2008-07-10 9:02

dude that's raw

Name: Anonymous 2008-07-10 9:15

>>9
RAW NAKED BARE EXPOSED UNABSTRACTED REVEALED OPEN PUBLIC WINDOWS API

Name: Anonymous 2008-07-10 9:39

Why would creating hundreds of buttons be slow? What is your shitty API doing?

Name: Anonymous 2008-07-10 9:57

>>11
that's a good point, even javascript isn't that bad...
data:text/html,<body><script>for(var i=0;i<2000;++i){var b=document.createElement('input');b.type='button';document.body.appendChild(b)}</script></body>

Name: Anonymous 2008-07-10 11:55

>>12
It is infinitely long in my IE.

>>11
Not just creating; creating and waiting for each button to get shown. Again, I am not expert, it might be something different.

Name: Anonymous 2008-07-10 11:58

>>13
Again, I am not expert, it might be something different.
It is. Learn to use a profiler.

Name: Anonymous 2008-07-10 12:07

>>14
So, enlighten us.

Name: Anonymous 2008-07-10 12:10

>>15
You're the only one still unenlightened. Away with you.

Name: Anonymous 2008-07-10 13:52

I suggest using Java. Problem solved.

Name: Anonymous 2008-07-10 13:54

>>16
I was not really interested.

Name: Anonymous 2008-07-10 14:12

Try calling this.SuspendLayout(); and this.ResumeLayout(true); around the code which adds all the buttons.

Name: Anonymous 2008-07-10 14:22

Create a damn button class.

Name: Anonymous 2008-07-10 14:46

In HASKELL, we would create a button class, give it the necessary methods, create a loop that would make enough instances of the class and write a recursive factorial.

Name: Anonymous 2010-12-28 9:33

Name: Sgt.Kabu緀㇅kiman豌餷 2012-05-24 10:41

All work and no play makes Jack a dull boy
All᪋ፀ work and no play makes鉇᥿ Jack a dull䭇䕀 boy
All뢟ꉨ work and no play makes휅ꋰ Jack a dullꆳ boy
All⨜흓 work and no play makes턬흎 Jack a dullᏣ㖮 boy

Name: bampu pantsu 2012-05-29 4:06

bampu pantsu

Name: Anonymous 2013-01-19 23:37

/prog/ will be spammed continuously until further notice. we apologize for any inconvenience this may cause.

Don't change these.
Name: Email:
Entire Thread Thread List