Programming Forums
User Name Password Register
 

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

Reply
 
Thread Tools Display Modes
Old Dec 17th, 2005, 1:18 AM   #1
Steverino
Newbie
 
Join Date: Dec 2005
Posts: 4
Rep Power: 0 Steverino is on a distinguished road
Smile Math puzzle

hey, I'm trying to write a program for my TI89 calculator to solve the math puzzles seen below, so if this could be in very simple basic it would be helpful.

these are called Cross Math Puzzles http://www.pen.k12.va.us/Div/Winches...s/crosmth.html

Any help would be appreciated! thanx!
Steverino is offline   Reply With Quote
Old Dec 29th, 2005, 11:52 PM   #2
Steverino
Newbie
 
Join Date: Dec 2005
Posts: 4
Rep Power: 0 Steverino is on a distinguished road
Any help? even just a tip on where to begin?
Steverino is offline   Reply With Quote
Old Dec 30th, 2005, 12:46 AM   #3
PhilBon
Hobbyist Programmer
 
PhilBon's Avatar
 
Join Date: Nov 2005
Posts: 172
Rep Power: 3 PhilBon is on a distinguished road
Send a message via AIM to PhilBon Send a message via MSN to PhilBon
First off My knowledge of TI83 (i know it's not 89) is that it has it's own programming Lang. And your Post is Under VB and I don't think the TI89's can be programed with VB. Have you tried it yet? My first idea would be to create a VB program (very simple: "hello world") and see if it works, if it does then move on if not you'll have to learn the TI89 Lang. You might be able to use C because most computer chips run off of C (if I remember this correctly, someone correct me if i'm wrong). In order to do that in VB I would create a bunch of loops (this may not be the best, i'm not a pro at vb yet. That it starts at one number for box one puts it in then keeps on going for the 9 boxes (you'd have nine loops (it would take up a lot of memory possibly. Let me know if you need better understanding.
PhilBon is offline   Reply With Quote
Old Dec 30th, 2005, 2:28 AM   #4
Mouche
Newbie
 
Mouche's Avatar
 
Join Date: Dec 2005
Location: Oregon
Posts: 22
Rep Power: 0 Mouche is on a distinguished road
On the calc, you can program in BASIC. There are flash apps and ASM programs you can create on the computer and send them to the calculator. There's no Visual Basic (syntactically) or C for TI89s (or any other TI calculator as far as I know).

Sorry, but I can't help you on the puzzle...
__________________
--Programmer in-training--

"I think there is a world market for maybe five computers."
- Thomas Watson, chairman of IBM, 1943
Mouche is offline   Reply With Quote
Old Dec 30th, 2005, 2:44 AM   #5
SittingDuck
Programmer
 
SittingDuck's Avatar
 
Join Date: Nov 2005
Location: Moseley, Birmingham, England, Earth
Posts: 51
Rep Power: 3 SittingDuck is on a distinguished road
Quote:
Originally Posted by PhilBon
You might be able to use C because most computer chips run off of C (if I remember this correctly, someone correct me if i'm wrong).
Computer chips - by which I think you mean CPUs and MCUs (micro-controller units) - all have their own codes ("machine codes"), which are represented by assembly languages. Different CPUs and MCUs have their own instruction sets and formats - Intel CPUs have the Intel instruction sets, ARM MCUs have the ARM instruction set etc. C code just defines the algorithm in a target-independant form. The compiler converts the C code into the machine code of the target processor (hence you can't run a program compiled for Intel on an ARM processor). The computer can't tell what language the program was written in.
SittingDuck is offline   Reply With Quote
Old Dec 30th, 2005, 11:44 PM   #6
Steverino
Newbie
 
Join Date: Dec 2005
Posts: 4
Rep Power: 0 Steverino is on a distinguished road
can someone just tell me how to go about programming it, I mean,the language is a simple version of BASIC, (with a lot of GUI stuff), so it wouldn't be too hard to actually code, but if someone could just tell me what process I should use to solve these it'd be greatly appreciated. Thanks!
Steverino is offline   Reply With Quote
Old Dec 31st, 2005, 1:08 AM   #7
theproject
Newbie
 
Join Date: Dec 2005
Posts: 6
Rep Power: 0 theproject is on a distinguished road
Hi there.
Since this is not a determinated system of equations (because u have 6 equations ( 3 rows and 3 columns) and 9 "variables" u can not determine it directly ( there could be more than one solution) so the algorythm i sugest would be very similar to a soduku solver that is:
you start by having a list or array with all numbers from 1 trough 9 for all the squares. then you will eliminate all the numbers from all lists(or arrays) wich make the sentence impossible ( for instance a 1 or a 2 on the first square is impossible - because subtracting any number from 1 or 2 would result in something less than 2).
you repeat the previous step for all the lists until all lists in all squares contain only one number (wich is your solution) ...

as for implementing this on the TI-89 i don't know... only know TI-83 but if it's the same BASIC maybe i can help.

cya
theproject is offline   Reply With Quote
Old Jan 3rd, 2006, 4:19 PM   #8
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
Theproject's method would work but would not be very efficient (exponential order 9^n) so a really well coded implementation might solve a 30x30 grid within the lifetime of the universe, if you could dig up 5E214ish bytes of memory from somewhere.

Something like the Dancing Links algorithm would be more appropriate, or you could treat the whole thing as a giant set of simultaneous equations and run Newton-Raphson on the thing. An RPN tree with some more matrix wizardry would also work. You might want to take a look at a functional language such as Prolog as well, but in their current implementations they basically use trial and error.
Rory is offline   Reply With Quote
Old Jan 3rd, 2006, 7:22 PM   #9
Steverino
Newbie
 
Join Date: Dec 2005
Posts: 4
Rep Power: 0 Steverino is on a distinguished road
Hey Rory, wanna help me out? I'm relatively new to programming (hell, I'm just in high school). I googled all those approaches, it looks like Dancing Links is the best approach, but I just don't know where to begin when it comes to implementing it, my sn is soccerste@aol.com E-mail me if you want. Thanks!
Steverino 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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:40 PM.

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