This is the classical Lights Out game, written using the Doors CS BASIC Libraries (aka DCSb Libs), a feature of Doors CS 6.7 beta and higher. Use the arrow keys to move the cursor around, [2ND] or [TRACE] to left-click, [CLEAR] to quit. If you turn all the lights out, you win the game. Note that 75% of all randomly-generated Lights Out boards are unsolvable. Doors CS 6.7 or higher required. Because of the way this works, I'll admit it's on the rather slow side; this isn't the best use of the GUI libraries. However, it's a fun one, and it shows what nifty stuff you can do in less than 1KB with Doors CS libraries and a single program. Screenshots and code below for your edification.

Download
Lights Out DE v1.0



BASIC Code wrote:
::DCS6
:"43C20C3010089009200420042244A3C5124812484E7205A0066005A0066003C0
:If 1337≠det([[42
:Then:ClrHome
:"Doors CS 6.7 or","higher requird","dcs.cemetech.net
:Return:End
:real(0,0
:{5,5→dim([J]
:For(A,1,5
:For(B,1,5
:randInt(0,1→[J](A,B
:End:End
:sum(10
:sum(7,2,8,8,"7088A85070","Lights Out
:sum(7,5,32
:sum(7,4,1,32,"By Kerm Martian
:sum(7,4,55,3,0,"Moves
:{45,32→L6
:DelVar QDelVar MRepeat Q
:sum(7,13,50,10,M,M,M
:For(A,1,5
:For(B,1,5
:sum(7,16,9+6B,‾5+6A,5,sub("F8888888F8F8F8F8F8F8",1+10[J](A,B),10
:End:End
:sum(7,14,15,1,30,30
:sum(12,L6(1),L6(2),2→L6
:not(L6(4→Q
:If 5=L6(4
:Then
:int((L6(2)/6)-2→A
:int((L6(1)/6)-3→B
:1-[J](A,B→[J](A,B
:If A≠1
:1-[J](A-1,B→[J](A-1,B
:If A≠5
:1-[J](A+1,B→[J](A+1,B
:If B≠1
:1-[J](A,B-1→[J](A,B-1
:If B≠5
:1-[J](A,B+1→[J](A,B+1
:M+1→M
:End
:sum(8,27
:End
:If Q=2:Then
:sum(8,1
:sum(7,4,10,1,0,"Congratulations!
:"300C481257EA581A2814281428141008100808100420024002400C3010081FF8
:sum(7,17,43,11,2,16,Ans
:sum(7,17,15,11,2,16,Ans
:sum(12,45,32,2
:End
:sum(10
:ClrHome
:Disp "LIGHTS OUT DE","BY Kerm MARTIAN
Generated by SourceCoder, © 2005-2010 Cemetech
Late.

You know something's wrong when this is the first thing that comes to mind after reading the topic title Razz

But wow, that's a lot smaller than anything written in BASIC would be.

And as for 75% being unsolvable, what about making the program start with a completely black board and go backwards randomly? That way all boards will be solvable.
Yeah, I'm curious what could be done to generate 100% solvable boards.
That would work very nicely, good idea. I wonder what's out there in terms of less-iterative Lights Out boards, if there's some formulaic way to generate the boards.
I cant slove any of them Sad (I dont like puzzles too much though...)
awwwwwww qazz
qazz42 wrote:
I cant slove any of them Sad (I dont like puzzles too much though...)
It's possible you just got all impossible boards. Smile Sorry to hear it.
or I am stupid, either one

edit: did you spell required wrong? :O
I did indeed, thanks for catching that. Although as I told Sonlen while attempting to stop him from making a game of trying to catch my mistakes (Wink), I'd prefer a slightly nicer way of noting it. Nevertheless, I appreciate the note, and if I ever update this game, I'll be sure to fix it.
sorry, didn't realize I sounded rude Sad I was just wondering weather if you noticed.... and if you misspelled it on purpose or not
whether*
_player1537 wrote:
whether*


I know, no matter which one I am using, I always use weather for some reason.....
The way I remember it is: If I am talking about the condition on the atmosphere, weather. Else, there's a fairly good chance I'm talking about a choice, so I just kinda choose "whether" most often. (Weirdly enough, I keep almost spelling it "wheter" <.>)
no, I know the difference, but I can never spell whether right, so I just use weather
Ah, in that case: <3 spellcheck Razz
Wheter's a word, isn't it?

EDIT: Never mind, whetter Very Happy
wheater! I wheat!
Deep Thought wrote:
Wheter's a word, isn't it?

EDIT: Never mind, whetter Very Happy
A whetter is for whetting things. Weather comes from the sky. Whether is a choice.

@Qazz: I could see how you might think I had done that for space or something, but since that line is currently 14 characters, not 16, I could definitely fit the missing 'e'.
I think I saw this when you first made an announcement about it (this topic), but then you made one about the newest version of DCS, and included pretty much the same stuff as this post had, so I didn't post here. As I probably said in the other topic, very nice with the program! Smile btw, out of random curiosity, is there a way with DCS to let you scroll through icons yourself? Like, I was thinking about a game for DCS that let you scroll through a bunch of rows of icons going downwards, with new ones appended at the top. Also, I don't know how feasible this would be, but what about replacing ".db 0,Width,5 byte icon" in a string with a custom character?
Sadly, you'd have to implement that with your own scrollbar and logic, but it wouldn't be that terrible. Smile I'm a little confused about what you're asking in the last sentence of that post; would you mind clarifying?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
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

 

Advertisement