![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,827
Rep Power: 5
![]() |
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: ![]() |
|
|
|
|
|
#2 |
|
Expert Programmer
Join Date: May 2005
Location: East Lansing, MI
Posts: 663
Rep Power: 4
![]() |
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. |
|
|
|
|
|
#3 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,827
Rep Power: 5
![]() |
Re: Excel As A Programming Language!?
It took me an hour during school and about an hour more when I got home.
|
|
|
|
|
|
#4 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,827
Rep Power: 5
![]() |
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: ![]() |
|
|
|
|
|
#5 |
|
Hobbyist Programmer
Join Date: Dec 2007
Location: Durban, South-Africa
Posts: 169
Rep Power: 1
![]() |
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. |
|
|
|
|
|
#6 |
|
Professional Programmer
|
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 |
|
|
|
|
|
#7 |
|
Newbie
Join Date: May 2008
Location: teh interwebz
Posts: 22
Rep Power: 0
![]() |
Re: Excel As A Programming Language!?
impressive!
I may try to recreate that from scratch next time I'm bored in class ![]()
__________________
iEngage |
|
|
|
|
|
#8 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,827
Rep Power: 5
![]() |
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: ![]() |
|
|
|
|
|
#9 |
|
Programmer
Join Date: Jun 2007
Posts: 99
Rep Power: 2
![]() |
Re: Excel As A Programming Language!?
yeah thats pretty cool sane, should be interesting to see if this will work in Numbers
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 |