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

Username:   Password: 
 RegisterRegister   
 New Commands for Turing
Index -> Programming, Turing -> Turing Help
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Token




PostPosted: Sat Jun 25, 2005 6:15 pm   Post subject: (No subject)

HTML Help Workshop is the program that turings helpfile is created in, and yah i'll just edit the keyword lookup file, you're one smart cookie Gandalf Razz btw go on ICQ so that we dont have to keep chatting over the forum Rolling Eyes.
Sponsor
Sponsor
Sponsor
sponsor
Token




PostPosted: Sat Jun 25, 2005 6:19 pm   Post subject: (No subject)

New Commands

Draw
ThickOval
ThickBox
Box3D
FillBox3D
Math
Slope
Isint
Circlearea
Screen
Shake
Str
??
Split
Array <new module
ShuffleInt
Input
KeySwitch
KeyCheck
Font
Center
The rest are on their way
jamonathin




PostPosted: Sat Jun 25, 2005 7:11 pm   Post subject: (No subject)

Gandalf wrote:
Simplicity is best! (usually, someone please don't get into an argument with me about this )
Thats what i go by Razz .

Anyways, I think I'm done with the Box3D and FillBox3D. If anyone has any suggestions for it, go for it.

Here are the help files for these 'commands', 'functions', 'procedures', 'whatever'. You may want to read through them just incase i used the wrong terms for things.



Draw.FillBox3D.doc
 Description:

Download
 Filename:  Draw.FillBox3D.doc
 Filesize:  28 KB
 Downloaded:  68 Time(s)


Draw.Box3D.doc
 Description:

Download
 Filename:  Draw.Box3D.doc
 Filesize:  27.5 KB
 Downloaded:  74 Time(s)

MysticVegeta




PostPosted: Sat Jun 25, 2005 7:21 pm   Post subject: (No subject)

Hehe all in one!!!!
code:
/* Created by : Tan.
 All 3 in one module!
 1: Reduces the Fractions into Lowest terms
 2: Finds the LCM in 2 denomintors
 3: Adds mixed fractions and results the answer in lowest terms!
 */

module Maths  %% Module

    export LCM, fractionAdd, Reduce %% .LCM

    fcn Reduce (whole : int, numerator : int, denominator : int) : string    %%% REDUCTION PROCEDURE

        var num := (denominator * whole) + numerator %% NUMERATOR
        var den := denominator %% DENOMINATOR
        var numorden : int
        var ans : string %% ANSWER

        if num mod den = 0 then %% IF IT IS A LIKE FRACTION
            ans := intstr (num div den) + "/" + "1"
            %%put ans
        else % IF IT IS AN UNLIKE FRACTION

            if den < num then   %% IF THE DENOMINATOR IS GREATOR THEN WE TAKE THE GCF FROM DECREASING DENOMINATOR
                numorden := den
            elsif den > num then %% VICE VERSA
                numorden := num
            end if

            for decreasing s : numorden .. 1 %% GREATEST COMMON FACTOR
                if (num mod s = 0) and (den mod s = 0) then
                    numorden := s %% NUM OR DEN NOW BECOMES THE GCF
                    exit
                end if
            end for

            if den > num then  %% ANSWERS
                %% IF IT CANT BE REDUCED MORE THEN
                ans := intstr (num div numorden) + "/" + intstr (den div numorden)
            elsif den < num then
                %% IF IT CAN BE REDUCED, EXPRESS IT AS A MIXED FRACTION
                ans := intstr ((num div numorden) div (den div numorden)) + " " +
                    intstr ((num div numorden) - (((num div numorden) div (den div numorden)) * den div numorden)) + "/" + intstr (den div numorden)
            end if
        end if

        result ans %% PUTTING THE MAIN ANSWER WE GOT

    end Reduce %% ENDING THE REDUCE


    %%%%% Finds the LCM %%%%%
    fcn LCM (denominator1 : int, denominator2 : int) : int %% Main Function

        var choice, ans : int %choice detemines whether to start counting from numerator or denominator

        if denominator1 > denominator2 then
            choice := denominator1 %if numerator is bigger then choice = numerator
        elsif denominator1 < denominator2 then
            choice := denominator2 %elsif it = denominator
        else
            choice := denominator1 %% both are equal
        end if

        loop
            exit when (choice mod denominator1 = 0) and (choice mod denominator2 = 0)
            choice += 1
        end loop

        ans := choice

        result ans

    end LCM %% Lcm Ends

    %%%%%% Adds the Fractions and then reduces them to lowest terms%%%%%%
    fcn fractionAdd (whole1 : int, num1 : int, den1 : int, whole2 : int, num2 : int, den2 : int) : string
        var wholetotal := whole1 + whole2
        var lcm := LCM (den1, den2)
        var numerator := ((lcm div den1) * num1) + ((lcm div den2) * num2)
        result Reduce (wholetotal, numerator, lcm)
    end fractionAdd

end Maths %% End Module

put Maths.Reduce (0, 10, 25) %Whole num, Numerator, denominator
put skip, Maths.LCM (8, 7) % Denominator1, Denominator2
put skip, Maths.fractionAdd (0, 1, 2, 2, 3, 4) %Whole1, Numerator1, Denominator1, Whole2, Numerator2, Denominator2
jamonathin




PostPosted: Sat Jun 25, 2005 7:40 pm   Post subject: (No subject)

Looks pretty good. (I cant test it right now) But it seems as if everything should work.

This probabily sounds like a useless comment, but that's because I wold have mroe to say, then I'd re-read the proggy, then edit, and so on.
Token




PostPosted: Sat Jun 25, 2005 7:50 pm   Post subject: (No subject)

alright, heres the file as it stands now, with all the data that people have sent me thanks for those jamonathin, and everyone else who took the time to fill them out, here we go! and i'm getting rid of the executable part of the template, so heres the updated template


The Extension 'rtf' was deactivated by an board admin, therefore this Attachment is not displayed.


Helpfile.zip
 Description:
Help file

Download
 Filename:  Helpfile.zip
 Filesize:  8.78 KB
 Downloaded:  70 Time(s)

jamonathin




PostPosted: Sat Jun 25, 2005 8:00 pm   Post subject: (No subject)

Looks pretty good. Only two things I would consider changing.

1. The format on Math.Isint is the only one that's tabbed out far enough (just for looks purposes).

2. Jamonithin = Evil or Very Mad _____ Jamonathin = Mr. Green

Looking pertsy goods though. It looks all official and stuff
[Gandalf]




PostPosted: Sat Jun 25, 2005 8:47 pm   Post subject: (No subject)

Quote:
2. Jamonithin = Evil or Very Mad _____ Jamonathin = Mr. Green

Laughing

Alright, I finally finished debugging the collection of all the new functions/modules. Please make sure your code is bug-free when you post it or else there are problems later on. I just spent a long time getting everything to work because of a few little bugs (some of the mine, granted). Here's the sum of everything we have so far:



Turing Addon Project.zip
 Description:
Project Updated.

Download
 Filename:  Turing Addon Project.zip
 Filesize:  18.54 KB
 Downloaded:  56 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
StarGateSG-1




PostPosted: Sat Jun 25, 2005 9:01 pm   Post subject: (No subject)

This questions is meant for cervantes only because I know he can answer it but, if anyone else knows they could answer it as well. My nquestion is how do you hide a password in a textfield.
Cervantes




PostPosted: Sat Jun 25, 2005 9:08 pm   Post subject: (No subject)

Hide a password? You mean, with asterisks? All you have to do is change the output type to be "stars". There's a procedure for it, called setOutputType. Call that, with the arguement being "stars". Alternatively, you could just set it as "stars" when you INITialize the object.
You can look through the source code of my FP if you want for examples.
Maybe soon I'll add to that textfield so that you can use the mouse and shift keys for highlighting.
lyam_kaskade




PostPosted: Sun Jun 26, 2005 12:24 am   Post subject: (No subject)

This might be a bit off topic, but I was just thinking that all the Turing commands are written in C++, and then called by the Turing program through external. But we are writing new commands in Turing, which will likely be much slower (like the draw commands, has to call the C++ code every time a new draw is done). Is there any way we can make new commands for Turing that aren't written in Turing?
Also, does anyone know if the external command requires that the language be C++? Or can it be any language?
wtd




PostPosted: Sun Jun 26, 2005 12:26 am   Post subject: (No subject)

lyam_kaskade wrote:
This might be a bit off topic, but I was just thinking that all the Turing commands are written in C++, and then called by the Turing program through external. But we are writing new commands in Turing, which will likely be much slower (like the draw commands, has to call the C++ code every time a new draw is done). Is there any way we can make new commands for Turing that aren't written in Turing?


You would likely have to compile any such library code directly into the Turing executable. That wouldn't be possible without more information than any of you likely have.
Token




PostPosted: Sun Jun 26, 2005 9:04 am   Post subject: (No subject)

wtd wrote:
You would likely have to compile any such library code directly into the Turing executable. That wouldn't be possible without more information than any of you likely have.


Would you happen to have any of this information WTD? Laughing or anyone really for that matter Question
MysticVegeta




PostPosted: Sun Jun 26, 2005 9:06 am   Post subject: (No subject)

hehehe, messing with the assembly after unpacking turing lol. Laughing
MysticVegeta




PostPosted: Sun Jun 26, 2005 9:10 am   Post subject: (No subject)

on topic : hey, you know i think alikhan made a base converter, maybe we can make commands for logrithmic functions. Wink
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 6 of 8  [ 119 Posts ]
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next
Jump to:   


Style:  
Search: