Author |
Message |
|
CDI
Advanced Member
Joined: 05 Nov 2005 Posts: 267
|
Posted: 04 Apr 2006 05:47:11 pm Post subject: |
|
|
Okay, first, the question.
can the 89 do boolean logic? (i.e. c+(x=443)->c)
Also... is this a good example of an 89 MineSweeper Game in BASIC? ( for norm 89 users run sweeper() 89TE users can run both sweeper() and sweep89t() the latter times the game)
The keys are...
Up, Dn, Lt, Rt = Move
2nd + Up, Dn, Lt, Rt = Move to bound
Enter = Select Square
2nd + Enter = Flag
Esc = Quit
Also... is there a way to do floodfill on the 89? Acually... I can do it, I just need to know how to floodfill in the first place |
|
Back to top |
|
|
IAmACalculator In a state of quasi-hiatus
Know-It-All
Joined: 21 Oct 2005 Posts: 1571
|
Posted: 04 Apr 2006 05:59:39 pm Post subject: |
|
|
CDI wrote: Okay, first, the question.
can the 89 do boolean logic? (i.e. c+(x=443)->c)
[post="74057"]<{POST_SNAPBACK}>[/post]
That sort of stuff is obsoleted by the [font="Courier"]when( command. [font="Courier"]when(condition,returniftrue,returniffalse,returnifundef), e.g. [font="Courier"]when(x=443,c+1,c)⇒C
Last edited by Guest on 04 Apr 2006 06:03:39 pm; edited 1 time in total |
|
Back to top |
|
|
CDI
Advanced Member
Joined: 05 Nov 2005 Posts: 267
|
Posted: 04 Apr 2006 06:58:16 pm Post subject: |
|
|
ah, that makes things like
c+(x=#1)-(x=#2)+(x-c)(x=#3)-(c-1)(x=#4)->c hard then |
|
Back to top |
|
|
Liazon title goes here
Bandwidth Hog
Joined: 01 Nov 2005 Posts: 2007
|
Posted: 04 Apr 2006 07:10:58 pm Post subject: |
|
|
why do you need 2 versions? Are you using the clock for the 89Ti only version? |
|
Back to top |
|
|
SilverCalcKnight |_
Active Member
Joined: 15 Nov 2005 Posts: 577
|
Posted: 04 Apr 2006 07:11:48 pm Post subject: |
|
|
Nice, but unless I forgot to send something, there could be an error. When it is finished loading, I get an 'undefined variable' error message. I am using the 89Ti version, I'll try the 89 version... |
|
Back to top |
|
|
CDI
Advanced Member
Joined: 05 Nov 2005 Posts: 267
|
Posted: 04 Apr 2006 07:16:53 pm Post subject: |
|
|
really? maybe I forgot to copy something... lemme check... -nope.
@liazon - Quote: ...89TE users can run both sweeper() and sweep89t() the latter times the game) |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 04 Apr 2006 07:16:54 pm Post subject: |
|
|
Re: floodfill - just do it recursively. Something like Code: Define flood(row,col)=Prgm
clear grid[row,col]
If this is a blank square Then
flood(row-1,col)
flood(row+1,col)
flood(row,col-1)
flood(row,col+1)
EndIf
EndPrgm
It's a lot trickier on the 83+.
Last edited by Guest on 04 Apr 2006 07:17:10 pm; edited 1 time in total |
|
Back to top |
|
|
CDI
Advanced Member
Joined: 05 Nov 2005 Posts: 267
|
Posted: 04 Apr 2006 07:18:15 pm Post subject: |
|
|
erm, would that have the same effect as when you click an empty space on the comp version of Minesweeper and it uncovers like 20 spaces? (I already do 9) |
|
Back to top |
|
|
Liazon title goes here
Bandwidth Hog
Joined: 01 Nov 2005 Posts: 2007
|
Posted: 04 Apr 2006 07:26:20 pm Post subject: |
|
|
CDI wrote: really? maybe I forgot to copy something... lemme check... -nope.
@liazon - Quote: ...89TE users can run both sweeper() and sweep89t() the latter times the game)
[post="74093"]<{POST_SNAPBACK}>[/post]
I was just wondering why you took the trouble to make so many versions. |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 04 Apr 2006 07:32:16 pm Post subject: |
|
|
CDI wrote: erm, would that have the same effect as when you click an empty space on the comp version of Minesweeper and it uncovers like 20 spaces? (I already do 9)
[post="74095"]<{POST_SNAPBACK}>[/post] Yeah. Except that I accidentally left out going diagonally, so you should add that too (it doesn't matter in most cases though).
For the many-versions problem:
1. The 89 regular also has a timer. At least, mine does.
2. You can use getConfg() to find out which calculator you have, and thereby determine if you should use the timer.
Last edited by Guest on 04 Apr 2006 07:32:37 pm; edited 1 time in total |
|
Back to top |
|
|
CDI
Advanced Member
Joined: 05 Nov 2005 Posts: 267
|
Posted: 04 Apr 2006 07:38:45 pm Post subject: |
|
|
oh good idea, thanks ;)
so the regular 89 can use getTimer() (or w/e it is)
@liazon - I just did a quick move/rename/remove then edited 2 lines for the time |
|
Back to top |
|
|
sexybear979
Newbie
Joined: 27 Mar 2006 Posts: 28
|
Posted: 08 Apr 2006 12:24:04 am Post subject: |
|
|
is there a seconds timer? i've only seen a minutes timer. if there is, can someone show me the function it uses? |
|
Back to top |
|
|
IAmACalculator In a state of quasi-hiatus
Know-It-All
Joined: 21 Oct 2005 Posts: 1571
|
Posted: 08 Apr 2006 08:08:35 am Post subject: |
|
|
starttmr() returns the total amount of seconds, so you could do something like this for a timer program...
Code: timer()
local x
starttmr()⇒ x
loop
output starttmr()-x,0,0
endloop
Something like that anyway. |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 08 Apr 2006 12:41:34 pm Post subject: |
|
|
checkTmr(x) is made just so you don't have to do startTmr()-x. |
|
Back to top |
|
|
IAmACalculator In a state of quasi-hiatus
Know-It-All
Joined: 21 Oct 2005 Posts: 1571
|
Posted: 08 Apr 2006 01:09:35 pm Post subject: |
|
|
Ah, really? That would have been nice to know... |
|
Back to top |
|
|
|