Computer Science Canada Turing Conversion program |
Author: | TaKer [ Sun May 30, 2010 10:06 pm ] | ||
Post subject: | Turing Conversion program | ||
What is it you are trying to achieve? i am trying to create a program that will allow 12 conversions. Decimal- binary, Dec-hexa, Dec-Oct and so forth. What is the problem you are having? I need help creating this program as i need the program to use functions I have used the search button so please dont bother rubbing it in my face. The programs i found do not use functions, so they are not of much use to me. Here is the code i have so far with the initial start up to the program. I am new to this and have very little clue to what i am doing. If you can help me with the other functions i will be greatful
Please specify what version of Turing you are using <Answer Here> |
Author: | Insectoid [ Sun May 30, 2010 10:38 pm ] |
Post subject: | RE:Turing Conversion program |
You can do this whole thing with one function that takes a number to be converted, its current base and the base to convert to. It's a math thing more than a programming thing. I've got a ruby or perl version of this somewhere but I doubt you can read it. |
Author: | TaKer [ Sun May 30, 2010 10:46 pm ] |
Post subject: | RE:Turing Conversion program |
Right now i am looking for the longer way as the teacher expects me to have 12 functions... |
Author: | Insectoid [ Sun May 30, 2010 11:01 pm ] |
Post subject: | RE:Turing Conversion program |
Your teacher expects you to be retarded. Make one good function that is worthy of handing in, then a pile of stupid useless ones that do nothing useful. God, I hate this curriculum. |
Author: | Tony [ Mon May 31, 2010 12:12 am ] |
Post subject: | RE:Turing Conversion program |
Insectoid's point is that all of those functions are almost identical. If you can write one, you can write them all. Taking it a step further -- all of those differences could be replaced by using a variable for the base. You might also be interested in strint -- that will change your "2"s to 2s, so that you don't have to write out all of the if-elsif-elsif-...s |