MINESWEEPER for the HP PRIME



#14

My 2nd game for the HP PRIME.....MINESWEEPER

http://my.tbaytel.net/tgallo/hp%20prime/


#15

Now we learn what the PRIME is made for.

d;-)


#16

There is a MINESWEEPER on the 48 too. And on the 50g. :P


#17

As I always said: those graphic calcs are for students only, not for students nor professionals (sorry for the ambiguity of the English language).

d:-)


#18

I seem to remember a version for the 42S as well....

Found it: Mine Hunt.


- Pauli

Edited: 10 Dec 2013, 5:09 a.m.


#19

Uh-oh! Someone just hit a mine with that argument...

TW

#20

Quote:
As I always said: those graphic calcs are for students only, not for students nor professionals (sorry for the ambiguity of the English language).

d:-)


Not sure why some people are so anti-calc-games when people should be free to do what they want with the calc they paid for? If HP/TI/Casio didn't want games to be made on those calculators, they would never have included drawing/iskeydown commands, let alone gambling card symbols in the programming languages. Don't wonder why certain people boycott both the HP Museum and TI-Nspire User Group forums and why certain TI forums who are sick of TI and their TI-Crapspire are starting their own HP discussion instead of coming here.

Besides, to make calculator games, especially 3D ones, you need to know math anyway.

Anyway, if anybody wants to discuss or showcase calculator games and game-related projects on a calculator forum that is free of people who are against calculator games (they would get banned for trolling after a while), you should go to http://www.omnimaga.org/index.php?board=214.0 (hacking/programming) or http://www.omnimaga.org/index.php?board=212.0 (project/software showcase).


Edited: 10 Dec 2013, 2:49 p.m.

#21

Reminds me of this guy:





Jack Lebrowitski.

He was in charge of monitoring voltage levels in the oxygen tanks on the Appolo 13 mission. In this photo you can clearly see him distracted from his terminal as a fellow engineer demonstrated just out of picture:


"If you enter the number "5318008" on your terminal, and then do a hand-stand, it spells out the word ..."


The rest, as they say, is history.


Now lets all get back to work.

#22

Well, by your logic the HP-67 was also just a toy, since its Standard Pac of program cards included a game called Moon Rocket lander. Actually, I'm quite surprised that hp did not include some sort of game App as standard issue.

#23

Tony, your games are great.

I made a video :

http://youtu.be/-sH14vzc4yU

#24

Hello,

Nice work...

I had a quick look at the code and here are some comments:
(Note: since HPPL is a new language, what you write might end up being used by others as example code, as a result, it would pay for it to be as 'clean' as possible!)


- Look at the ICON documentation (in online help). It is used to creae sprites and bitmaps for use in programs. It will allow you to create better graphics with faster on screen drawing and less code.
you can download the ICON creator helper program at: http://h30499.www3.hp.com/hpeb/attachments/hpeb/bsc-408/14143/1/lodepng.zip

- Look at the makelist instruction. It is very powerfull! Anytime you need to create a list (either in a for loop or even staticaly), see if it can be used.
For example, minefield:={10,10,10,.....,10,10,10,10,10};
can be replaced by minefield:=makelist(10,1,100);

- more on list:
case
if bombcount == 0 then color := RGB(100,20,250); end;
if bombcount == 1 then color := RGB(1,0,254); end;
if bombcount == 2 then color := RGB(1,127,1); end;
if bombcount == 3 then color := RGB(254,0,0); end;
if bombcount == 4 then color := RGB(1,0,128); end;
if bombcount == 5 then color := RGB(129,1,2); end;
if bombcount == 6 then color := RGB(0,128,129); end;
if bombcount == 7 then color := RGB(0,0,0); end;
if bombcount == 8 then color := RGB(128,128,128); end;
end;
can be replaced by a list lookup:
local MyListOfCOlor= { RGB(100,20,250), ...}; // you could even have the list a global non exported variable. even faster.
color=MyListOfCOlor(bombcount+1);


- Avoid mixing CAS with non cas programs. look at the MOD and IP/FP functions as replacements for irem and iquo
I := irem(index-1,10);
J := iquo(index-1,10);


- look at the WAIT(-1) command. this is what you should use to wait for key presses/mouse events as it is low power consumption and returns all the info you want/need.

Cheers, Cyrille


Edited: 10 Dec 2013, 8:33 a.m.


#25

Are you sure about this line?

minefield:=makelist(10,1,100);

I thought makelist needs a variable to work. I get a syntax error when I check the program with the above line.


#26

Try

minefield:=makelist(10,A,1,100);
#27

thanks for the suggestions Cyrille!

#28

This is great, thanks Tony! I remember playing Minesweeper during college. Mastermind is great too.

Eddie

#29

updated it....cleaned up some code as per Cyrille's suggestion and fixed some small bugs


Possibly Related Threads...
Thread Author Replies Views Last Post
  New HP39gII programs (snake, minesweeper, ...) Mic 8 705 02-23-2013, 08:13 PM
Last Post: Eddie W. Shore

Forum Jump: