Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 13th, 2008, 4:55 PM   #1
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,827
Rep Power: 5 Sane will become famous soon enough
Talking Excel As A Programming Language!?

I coded Dijkstra's Algorithm purely in Excel today! No Macros or Visual Basic either.

I did this in Data Management class out of boredom.

There is a maze that you can change by replacing the cells with 1 or nothing, and moving around "Start" and "Exit". It will calculate the shortest path to the exit by running Dijkstra's Algorithm on 7 worksheets, and displaying the path back on the original worksheet. Even though the edges are of uniform weight, I decided not to use a BFS because I figured implementing a priority queue in Excel is easier than a normal queue.

The maze is limited to 6x6 because this was just a couple hours of work. Didn't want to get too out of hand by making it dynamic.

I've zipped and attached the complete .xls file if anyone's interested. To delete a wall, click the block and hit "Delete". To add a wall, click an empty square and type "1" then "Enter". To change the Start and Exit, it should be obvious what to do. Remember it's limited to 6x6.

Below is a screenshot of it in action on two separate mazes:

Attached Files
File Type: zip Dijkstras_Algorithm.zip (106.5 KB, 8 views)
Sane is offline   Reply With Quote
Old May 13th, 2008, 5:12 PM   #2
OpenLoop
Expert Programmer
 
OpenLoop's Avatar
 
Join Date: May 2005
Location: East Lansing, MI
Posts: 663
Rep Power: 4 OpenLoop is on a distinguished road
Re: Excel As A Programming Language!?

Impressive. How long did it take you to make this?

Excel can come in handy in day to day work. The actuarial department where I work uses Excel to calculate thousands of values for insurance policies. Each spreadsheet is about 30mb worth of formulas, binary solves, and a few macros to calculate the monthly premiums, cash value, interest, fees, and many other values over the life of a policy (~90 years). Luckily, I only have to look at the values and match them to the real thing on the admin system to fix values issues.
OpenLoop is offline   Reply With Quote
Old May 13th, 2008, 5:15 PM   #3
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,827
Rep Power: 5 Sane will become famous soon enough
Re: Excel As A Programming Language!?

It took me an hour during school and about an hour more when I got home.
Sane is offline   Reply With Quote
Old May 13th, 2008, 5:49 PM   #4
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,827
Rep Power: 5 Sane will become famous soon enough
Re: Excel As A Programming Language!?

I found that 6x6 is too small, so I extended it to handle 12x12 and it still works lightning fast (thanks to Dijkstra).

Unfortunately, the .xls file is 11MB so I can't attach it to this post.

But here's a screen shot for what it's worth:

Sane is offline   Reply With Quote
Old May 14th, 2008, 1:36 AM   #5
BstrucT
Hobbyist Programmer
 
BstrucT's Avatar
 
Join Date: Dec 2007
Location: Durban, South-Africa
Posts: 169
Rep Power: 1 BstrucT is on a distinguished road
Re: Excel As A Programming Language!?

Very impressive!

Never knew one could program in Excel :-)

>BstrucT
__________________
The more the human race tries to change everything, when not needed, the less will they be able to change themselves when they need to.
BstrucT is offline   Reply With Quote
Old May 14th, 2008, 3:33 PM   #6
Wizard1988
Professional Programmer
 
Wizard1988's Avatar
 
Join Date: Oct 2005
Location: Chitown
Posts: 417
Rep Power: 3 Wizard1988 is on a distinguished road
Send a message via AIM to Wizard1988
Re: Excel As A Programming Language!?

Awesome job Sane. Suprisingly Excel can be used for a bunch of stuff. For example you can have it render 3D objects http://www.gamasutra.com/view/featur...ionary_3d_.php I'm not sure how usefully doing something like this is, but it might be effective against boredom.
__________________
JG-Webdesign
Wizard1988 is offline   Reply With Quote
Old May 14th, 2008, 5:23 PM   #7
iEngage
Newbie
 
iEngage's Avatar
 
Join Date: May 2008
Location: teh interwebz
Posts: 22
Rep Power: 0 iEngage is on a distinguished road
Re: Excel As A Programming Language!?

impressive!

I may try to recreate that from scratch next time I'm bored in class
__________________
iEngage
iEngage is offline   Reply With Quote
Old May 15th, 2008, 9:47 PM   #8
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,827
Rep Power: 5 Sane will become famous soon enough
Re: Excel As A Programming Language!?

I've managed to zip and attach the 12x12.

Here's one more screenshot if you're interested to see what the tables look like.

It's simply 1 row for each iteration of the algorithm. Each iteration fills in the current state of all of the variables in 1 array. Likewise, there is 1 worksheet for each array.



And another maze for kicks:

Attached Files
File Type: zip Dijkstras_Algorithm_Bigger.zip (1.47 MB, 3 views)
Sane is offline   Reply With Quote
Old May 15th, 2008, 10:37 PM   #9
MiKuS
Programmer
 
Join Date: Jun 2007
Posts: 99
Rep Power: 2 MiKuS is on a distinguished road
Re: Excel As A Programming Language!?

yeah thats pretty cool sane, should be interesting to see if this will work in Numbers
MiKuS is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The D programming language Baphomet Other Programming Languages 58 Sep 11th, 2007 1:31 AM
io programming language bulio Other Scripting Languages 3 Jul 13th, 2007 8:34 AM
The C programming Language (2nd Edition) nnxion Book Reviews 10 Jul 6th, 2007 3:29 PM
Which Programming Language You Use The Most? Soulstorm Coder's Corner Lounge 19 Apr 6th, 2007 10:29 PM
Which Programming Language for Beginner ? nkanthikiran Other Programming Languages 18 Jan 21st, 2006 5:53 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:34 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC