Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Turing Swiss Army Knife
Index -> Programming, Turing -> Turing Submissions
Goto page 1, 2, 3, 4  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
.hack




PostPosted: Fri Feb 06, 2004 4:27 pm   Post subject: Turing Swiss Army Knife

Well, I've started programming a "swiss army knife" like tool in Turing. What it basically is, is a conversion program. Right now I am working on, measurements, weighy, temperature and money conversions. THis is just a simple utility for doing quick math, if you want to know how many CM are in a foot, jus followt he menus to convert feet into Centimetres etc. And the same goes for weight, temp etc etc.

I plan on adding more conversions, and I am even trying to create text menu Razz.

Oh well, this is just what I am working on, if anyone is interested in it, I can post it up, I know its not too high tech, but for my skill level it is(I just finished a program that allows the input of a cars travelliug start time, end time, distance and then outputs the total time and average speed Very Happy

Oh well, just so you guys know of the things to come Smile
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Fri Feb 06, 2004 4:31 pm   Post subject: (No subject)

A good program to make. Post the code; if it isn't very efficient we can teach you how to make it more efficient.

Also on a program like this I would suggest going a bit overboard and learning how to make menus. Either learn GUI, or make your own using Mouse.Where or Input.KeyDown.
.hack




PostPosted: Fri Feb 06, 2004 4:35 pm   Post subject: (No subject)

thanks for the advice, I was planning something like this

if 1 = 1 then
put "you have selected blah blah blah"
get rCM
rAns := rCM *2.14
put "rCM is equal to ", rAns

or something liek that and use if statements for most of the options with Else statements. I would have to make the menus effiecien enough so Id idn't have like 800 if statements.

remember its like my 5th learning turing at school, so I don't know too much =/
Cervantes




PostPosted: Fri Feb 06, 2004 5:03 pm   Post subject: (No subject)

text based? if your up for it, I would suggest trying to make buttons and such

ie. have a main menu where you click on the button you want (say, "INCHES <--> CM") and it takes you to a new screen where you enter the value for INCHES in a textbox and click convert and it appears in the CM text box.

That would be fairly hard. if you try it just do the first one, then post it Smile
Dan




PostPosted: Fri Feb 06, 2004 6:30 pm   Post subject: (No subject)

migth as well post it all since u all ready stared this topic, lol.

P.S. i saw ur name is .hack, that have anything to do with .hack// anime?
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
.hack




PostPosted: Fri Feb 06, 2004 10:04 pm   Post subject: (No subject)

code:
%||Name: Stuart Montreuil                                                   ||
%||Class: ICS3M                                                             ||
%||Program File: StuartM51                                                  ||
%||Description: Large Conversion Program for Length,Weight,Temp             ||



%Variables for Length Conversion
var rInch,rCM,rMM,rM,rMile,rKM,rFt : real

%Variables for Solid Weight Conversion
var rPnd,rGrm,rKgrm,rOnc,rMgrm : real

%Variables For Liquid Weight Conversion
var rL,rMl,rOun,rGal : real

%Code
put "Choose a Conversion Topic:"
put ""
put "1.","Length and Width Measurements"
put "2.","Solid Weight Measurements"
put "3.","Liquid Weight Measurements"
put "4.","Temperature"

if 1 = 1 then
put ""
put "Length And Width Measurments"
put ""
put "Choose Your Operation"
put ""
put "1.mm to centimetre."
put "2.mm to feet."
put "3.mm to metre."
put "4.mm to kilometre."
put "5.mm to miles."
put "6.cm to mm."
put "7.cm to feet."
put "8.cm to metre."
put "9.cm to kilometre."
put "10.cm to mile."


put "Please enter the length in Inches"
get rInch
rCM := rInch * 2.54
put " "
put rInch, " inches", " is ", rCM, " centimetres"
put " "

put "Measurement Utility Writen by .hack of Binary 3"
end if


is all I hav really done so far, and I know the code there is not complete. As you can see its going to be a biatch to code all of the if statements when everything is sort of jumbled together, but I believe I can pull through.

I watch very little anime, and have never played the game series. But .hack sounded cool and its geeky so I chose it Smile

P.S the codea t the bottom that is broken away from the large list of puts, is jsut the original code I to do in class for our assignment, so pretty much disregard that. its more like a model for me to view to keep self in check.
Cervantes




PostPosted: Sat Feb 07, 2004 9:49 am   Post subject: (No subject)

if you are having trouble keeping it organized, use procedures. they are very very easy to use / learn and will help enourmously for keeping you organized.

Looks not too bad, if you do make it text based then I would suggest making it look nice with background colours and text colours and a fancy title etc. Everything is better if it looks better!

you don't need to have that 'if 1=1 then" in there.. 1always=1, so there's no way that it could not enter that if statement.

what you would need eventually is a similar if statement around that section where you choose what measurments you want to convert. except you'll have a variable for your first choice (measurment, temperature, weight etc.) and then "if (thatvar)=1 then"

Good job, keep working on it Smile
.hack




PostPosted: Sat Feb 07, 2004 2:34 pm   Post subject: (No subject)

I'm willing to learn if you willing to teach Smile
Sponsor
Sponsor
Sponsor
sponsor
Maverick




PostPosted: Sat Feb 07, 2004 2:42 pm   Post subject: (No subject)

Hacker Dan created .hack.

Ya pretty good prog, but if you know how to create buttons and such it wil make it look a lot better. Stil good tho. +5BITS
.hack




PostPosted: Sat Feb 07, 2004 2:43 pm   Post subject: (No subject)

thank you Smile, I hope to have it released by sunday evening, but who knows.

It will look kind of repetitive seems how some other guy made on last night and put it up.
.hack




PostPosted: Sat Feb 07, 2004 2:52 pm   Post subject: (No subject)

yea, I think I'm going to need a scroll bar or something to be able to croll with for this.. so any ideas?

because it spawns choices down and you type in the choice number, but unfortunately the list is too long and gets cut off, so is ther any way to make a scroll bar type thing, or keyboard arrow pushes to scroll?
Maverick




PostPosted: Sat Feb 07, 2004 2:55 pm   Post subject: (No subject)

Well if you dont wanna do that just make the screen bigger.
Cervantes




PostPosted: Sat Feb 07, 2004 4:29 pm   Post subject: (No subject)

to make the screen bigger
code:
View.Set ("graphics:x value;y value")


for a scroll bar, you can use the GUI one. check out the help file on it.
.hack




PostPosted: Sat Feb 07, 2004 4:57 pm   Post subject: (No subject)

Awesome, thanks for the help. Well I got everything besides the scoll bar working. my formulas work and my coding structure also works. here is the geist of my code so far(Probably should have used arrays, but I = dumbass)

code:
%||Name: Stuart Montreuil                                                   ||
%||Class: ICS3M                                                             ||
%||Program File: StuartM51                                                  ||
%||Description: Large Conversion Program for Length,Weight,Temp             ||

%Other Variables
var Num : int
var Cho : int
var Amt : real
var Ans : real

%Code
put "Choose a Conversion Topic:"
put ""
put "1.","Length and Width Measurements"
put "2.","Solid Weight Measurements"
put "3.","Liquid Weight Measurements"
put "4.","Temperature"

if 1 = 1 then
put ""
put "Length And Width Measurment Conversions."
put ""
put "Choose Your Operation."
put ""

put "1.mm to centimetre."
put "2.mm to inch."
put "3.mm to feet."
put "4.mm to metre."
put "5.mm to kilometre."
put "6.mm to miles."
put " "
put "7.cm to mm."
put "8.cm to inch."
put "9.cm to feet."
put "10.cm to metre."
put "11.cm to kilometre."
put "12.cm to mile."
put " "
put "13.inch to mm."
put "14.inch to cm."
put "15.inch to feet."
put "16.inch to metre."
put "17.inch to kilometre."
put "18.inch to mile."
put " "
put "19.feet to mm."
put "20.feet to cm."
put "21.feet to inch"
put "22.feet to metre."
put "23.feet to kilometre."
put "24.feet to mile."
put ""
put "25.metre to mm."
put "26.metre to cm."
put "27.metre to inch."
put "28.metre to feet."
put "29.metre to kilometer."
put "30.metre to mile."
put ""
put "31.kilometre to mm."
put "32.kilometre to cm."
put "33.kilometre to inch."
put "34.kilometre to feet."
put "35.kilometre to metres."
put "36.kilometre to miles."
put ""
put "37.mile to mm."
put "38.mile to cm."
put "39.mile to inch."
put "40.mile to feet."
put "41.mile to metres."
put "42.mile to kilometres."
put ""
put ""
put "43. To Return To Conversion menu."
put "44. To Exit"
put "45. To Report Bug"
put ""
put ""
get Num

if Num = 1 then
put "Please enter Amount of mm."
get Amt
Ans := Amt/10
put "There is ",Ans," cm ","in ",Amt," mm"

elsif Num = 2 then
put "Please enter amount of mm."
get Amt
Ans := Amt/25.4
put "There is ",Ans,"inch(s) in ",Amt,"mm"

elsif Num = 3 then
put "Please enter amount of mm."
get Amt
Ans := Amt / 304.8
put "There is ",Ans," feet in ",Amt," mm"

elsif Num = 4 then
put "Please enter amount of mm."
get Amt
Ans := Amt / 1000
put "There is ",Ans," metre(s) in ",Amt," mm"

elsif Num = 5 then
put "Please enter the amount of mm."
get Amt
Ans := Amt / 1000000
put "There is ",Ans, " kilometre(s) in ",Amt,"mm"


elsif Num = 6 then
put "Please enter amount of mm."
get Amt
Ans := Amt / 1609344
put "There is ",Ans, " mile(s) in ",Amt," mm"

elsif Num = 7 then
put "Please enter amount of cm."
get Amt
Ans := Amt / .1
put "there is ",Ans," millimetre(s) in ",Amt," cm"

elsif Num = 8 then
put "Please enter amount of cm."
get Amt
Ans := Amt / 2.54
put "There is ",Ans," inch(s) in ",Amt," cm"

end if
end if



And so on and so forth for the rest of the options. I haven't done the section for weight and temperature yet, I'm jsut trying to get this working. Unfortunately I have to go outfor dinner tonight so this may but a delay on the release date.
Cervantes




PostPosted: Sat Feb 07, 2004 5:02 pm   Post subject: (No subject)

whoa thats crazy... definately use the inital system where you had menus to determine what type of thing you wanted to convert, like temp or distance.

keep working on it! Smile
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 4  [ 46 Posts ]
Goto page 1, 2, 3, 4  Next
Jump to:   


Style:  
Search: