forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Minesweeper game

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
jalih



Joined: 30 Jul 2012
Posts: 196

PostPosted: Wed Aug 01, 2012 8:56 pm    Post subject: Minesweeper game Reply with quote

Hi all,

I just put source and data files of my first ever program written in Fortran available: here

Any comments and insults about the code are welcome. Wink
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Thu Aug 02, 2012 2:40 am    Post subject: Reply with quote

Jalih,

I had a very quick look at your code. Not able to provide much of a comment, from the brief scan.

One thing I did notice is that in function gr_func() you have code only for 2 possible values of reason.
It would be worth keeping a track of other possible values of reason. The example I provided of call_back_statistics could be a way to monitor this. You can be surprised as to what are the other possible interrupts and then consider how best to respond to them. There may be some that you do not wish to respond to, in the way that follows in gr_func.

John
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Thu Aug 02, 2012 12:30 pm    Post subject: Reply with quote

Jalih,

It's a very creditable first effort.

Several of your subroutine calls refer to INTEGER FUNCTIONs, such as IMPORT_IMAGE@, SELECT_GRAPHICS_OBJECT@ - hence the linker warnings. FTN95 doesn't mind sometimes if these are called the wrong way, but there is still a right way.

If you want to use the complicated way of running graphics, then that is fine, but in an app like this that runs very fast you don't need to do all the stuff with different graphics regions, you can do it all on screen, using the "painter's algorithm" (each change overprints the last).

When you shut down the program (%cc), you don't need to tidy up, memory is released automatically. %cc is for use when the program shouldn't just close down without user intervention, for example, if you want to ask the user about saving files. In your case, maybe on %cc you should show the statistics on wins, losses etc. (In cases where files might need to be saved you probably need %ew as well).

It is a game, so consider adding sound effects. As programmed, there is no benefit in using the XP manifest (the line 1 24 default.manifest in your resources), except maybe to modernise the OK button in your About box - and the About ... menu item needs the dots afterwards because it leads you to another Window, and it probably needs to be About Sweeper ... Using the system font often looks better than choosing specific fonts when they are used at default size.

The 'reset' menu item is a clear example of a place to have an accelerator key, as is Exit (Ctrl-X usually).

Your mines would look more 3D if you moved the highlight up and left a bit. If you make the bevel effect a bit more complicated, then you will get a better visual effect when one tile is 'up' next to one that is 'down'. You have to be a bit careful with greys, as a lot of standard Windows themes use grey with a tint in it, and your tiles can look a bit flat in comparison.

As you are using Fortran 95 style, maybe you should use '>' rather than '.gt.' (I'm old-fashioned, and use the '.gt.' form, but it takes more space and is less clear).

Eddie
Back to top
View user's profile Send private message
jalih



Joined: 30 Jul 2012
Posts: 196

PostPosted: Thu Aug 02, 2012 6:55 pm    Post subject: Reply with quote

Thanks for comments and improvement suggestions!

I will try to put some of them into my code and will also add menu item for setting the game difficulty.
Back to top
View user's profile Send private message
jalih



Joined: 30 Jul 2012
Posts: 196

PostPosted: Fri Aug 03, 2012 10:59 am    Post subject: Re: Reply with quote

jalih wrote:

I will try to put some of them into my code and will also add menu item for setting the game difficulty.


Source and binary packages updated...
Back to top
View user's profile Send private message
jalih



Joined: 30 Jul 2012
Posts: 196

PostPosted: Mon Aug 06, 2012 7:18 am    Post subject: Re: Reply with quote

jalih wrote:
jalih wrote:

I will try to put some of them into my code and will also add menu item for setting the game difficulty.


Source and binary packages updated...

Some bugs fixed and sounds added...
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2814
Location: South Pole, Antarctica

PostPosted: Thu Aug 09, 2012 3:46 am    Post subject: Reply with quote

Cool!
Sell it when Win8 tablets will be available
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group