All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Logic
Lights On Diagonally (Posted on 2009-07-15) Difficulty: 3 of 5
"Lights Switched" toggles the cell selected and its immediate orthogonal neighbours.
"Lights On Diagonally" does exactly the same except that diagonal neighbours are toggled on or off, ie, if a neighbour is on it is turned off.

Select an "N x N" grid size to display that grid for examination.

Offer a lowest switching sequence for each grid (for the 3 x 3 it takes 5).

See The Solution Submitted by brianjn    
Rating: 4.5000 (2 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
re: to Brian Comment 7 of 7 |
(In reply to to Brian by pcbouhid)

Rather than try to copy the source code of each matrix go to View Source/View Page Source or whatever is available with your browser.

Javascript writes the numeric grid size links and then refers the one chosen to a new function which builds the grid "on the fly". This script does not change the HTML that comes down to your computer as such but makes the necessary changes somewhere in memory; when you select a different grid you create a change in memory (at least that's my understanding the process).

My browser suggests that "Lights On Diagonally" begins on line 91 and goes down to line 269.  All of that needs to be embodied in HTML, HEAD and BODY tags.

Better still I'll send you my HTML page.

  Posted by brianjn on 2009-07-16 22:17:06

Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (3)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information