
-----------------------------------
StarGateSG-1
Mon Jun 20, 2005 5:07 pm

New Commands for Turing
-----------------------------------
I am starting the summer project. And I want you the people to tell me what commands you would liek to see.

Here is the list so far.
Rotated draw oval
3D box - completed?
GUI
Thick basic shapes
Pic.Opacity
Triangles
Array average
Better sprites
Music player
Array Shuffle (2d arrays)
Draw line that works off slope 
Slope Func 
Advanced Math.tu 
stringSplit
button-switch for characters using Input.Keydown
LCD (lowest common denomonator)

-----------------------------------
GlobeTrotter
Mon Jun 20, 2005 8:35 pm


-----------------------------------
tan and tand

-----------------------------------
Bacchus
Mon Jun 20, 2005 9:19 pm


-----------------------------------
Get a newer version of Turing :P
tan tangent function (radians) 

Syntax   tan ( r : real ) : real
 
Description   The tan function is used to find the tangent of an angle given in radians. For example, tan (p/4) is 0.5.
 
Example   This program prints out the tangent of 0, p/6, 2p/6, 3p/6, up to 12p/6 radians.
tand tangent function (degrees) 

Syntax   tand ( r : real ) : real
 
Description   The tand function is used to find the tangent of an angle given in degrees. For example, tand (45) is 1.
 
Example   This program prints out the tangent of 0, 30, 60, 90, up to 360 degrees.

-----------------------------------
StarGateSG-1
Mon Jun 20, 2005 10:10 pm


-----------------------------------
Lol, I need to be more clear I don;t just want 2 word posts, there needs to be a reason behind.

Example:

Dealer module: This could be created to solve everyone's card dealing problems. Not the best example but along those lines, kinda spur of the moment.

-----------------------------------
GlobeTrotter
Mon Jun 20, 2005 10:51 pm


-----------------------------------
How about adding a drawoval/drawfilloval command that allowes you to draw rotated ovals, not just ones where the stretch is along the x/y axis.

-----------------------------------
StarGateSG-1
Tue Jun 21, 2005 2:05 am


-----------------------------------
ummm be more clear, do you mean 3-D??

-----------------------------------
Bacchus
Tue Jun 21, 2005 6:12 am


-----------------------------------
I think they mean an oval that is streched between the x and y axis, say stretched along a 45degree angle. As for the shuffling module, I don't think it should be made exclusivly for shuffling cards. If we do that then we'd be doing a big chunk of someones FP for them. Maybe something just to randomize the numbers that is inputted.

-----------------------------------
StarGateSG-1
Tue Jun 21, 2005 11:31 am


-----------------------------------
Ya I know, I needed an I at 1 am thats all, Like I said Bad example. But yes a array shuffler has been made already, but the guy has reposted after the crash. As for that circle I don't think that can be donw, correct me if I am wrong, but yes the Actucal command can be chnaged but I believe The actuacl funtion is hardcoded. We would have to invent a whole new circle command.

-----------------------------------
[Gandalf]
Tue Jun 21, 2005 11:41 am


-----------------------------------
I don't know, this might not be completely neccessary.  It would be nice to have a sortof "split" module.  It would take a filled in circle (drawfilloval) or some other shape and assign each pixel to an array, keeping the x,y,and colour of it.  Then you could manipulate those pixels.  I don't know, that's my line of thinking right now (type of stuff I'm focusing on), and I'm not that creative.

It seems Turing is not really lacking too many commands, from the amount of responses this topic has been getting.  I think it's something about the actual environment and 'language'.

-----------------------------------
StarGateSG-1
Tue Jun 21, 2005 11:47 am


-----------------------------------
That could be interesting, I think that yes the inviroment is a problem, but there are lots of error's, for instance we could create a error database were it would give examples how to fix all error's, w could finish off the GUI, We could add more complex stuff to it. That is why we need xperts becasue not to many people are aware of problems or things to add. B ut we could even have fun and game modules if all else fails.

-----------------------------------
MysticVegeta
Tue Jun 21, 2005 12:28 pm


-----------------------------------
Can the oval thingy not be done by looping arcs? :think:

-----------------------------------
StarGateSG-1
Tue Jun 21, 2005 1:58 pm


-----------------------------------
Maybe Like I said in other post i need people to help me before I can move on. Brainstorming will Have to wait.

-----------------------------------
lyam_kaskade
Tue Jun 21, 2005 3:53 pm


-----------------------------------
 Can the oval thingy not be done by looping arcs? 

Unfortunately no. Arcs are also stretched along the x and y axis. What could work though, is an ellipse:


proc ellipse (X, Y, X2, Y2, size, col : int)
    for i : X2 - size .. X + size
        for j : Y2 - size .. Y + size
            if sqrt ((X - i) ** 2 + (Y - j) ** 2) + sqrt ((X2 - i) ** 2 + (Y2 - j) ** 2)  cjah then
       cfor(down,1,10,1)
    end if
end checksomething
cfor (up,1, 1, 10)
%stuff goes here
checksomething
end for

It's just a quick idea, just remembered that, not sure if its even possible :?.  I'll have to think on it more later.

Syntax would be:
cfor(up/down,forID,startnum,endnum)

-----------------------------------
Cervantes
Wed Jun 22, 2005 8:13 pm


-----------------------------------
Slow down, fellas.  There's nothing stopping you from editing Turing's built-in modules.
I've attached Turing's Math module, with an addition of my own (angle finder).  Go to the turing install folder\Support\predefs\ and replace Math.tu with my file.  (Don't worry, it works just fine and will not screw up your copy of Turing.  If you don't trust me, make a back up of the original Math.tu)  Then, run the following code:


Mouse.ButtonChoose ("multibutton")
var x1, y1, x2, y2 : real
var mx, my, btn : int
var firsthit := false

loop
    cls
    mousewhere (mx, my, btn)

    if btn = 1 and firsthit = false then
        firsthit := true
        x1 := mx
        y1 := my
    end if
    if btn = 100 then
        firsthit := false
    end if
    if firsthit = true then
        x2 := mx
        y2 := my
        drawline (round (x1), round (y1), round (x2), round (y2), black)
        locate (1, 1)
        put Math.Angle (x1, y1, x2, y2)
    end if
    View.Update
    delay (10)
end loop


-----------------------------------
Token
Wed Jun 22, 2005 8:21 pm


-----------------------------------
oh so that would make it much simpler, this way we wont have to import the files each time when we're working with it, i think for now we should just keep them in separate modules and then start incorperating it into their respective sections afterwards

-----------------------------------
Cervantes
Wed Jun 22, 2005 8:36 pm


-----------------------------------
i think for now we should just keep them in separate modules and then start incorperating it into their respective sections afterwards

[accent="butchered french"]En contrare, mon amie (sp?).[/accent]
That's more work.  There's no harm in making modifications all the way through.  As I suggested in my email to stargate, everyone working on the project should have multiple copies of the turing install on their harddrive.  (3 copies, I think.)  1.) is the main one.  2.) is for their own modifications.  3.) is for testing the modifications of others.  If you want to test someone elses modifications, just copy his new .tu files into the predefs folder of the third install and try them out.

Oh, also I forgot to add in my last post: Jorbalax, why have just an ArrayShuffle module?  Why not make a general Array module that has shuffling, sorting, & searching?

On that note, I was wondering earlier about having modules inside modules.  It can be done, though Turing will give you warnings all over the place.  Despite this, everything runs fine.  I think StarGate, you should ask Holtsoft about looking into this.  Having modules within modules would help to keep things better structured (for example, Array module contains a shuffle module, sort module, and search module).  Warnings appearing all over the place whenever someone trys to use the new features would surely not be so impressive.

Zylum: Sounds awesome!! :D

-----------------------------------
36002
Thu Jun 23, 2005 7:52 am


-----------------------------------
What about the net commands? Can we do anything about those? Like somehow speed it up, compression maybe? Also, in PHP there is a command called "explode" which breaks up a string into an array at a certain symbal. An example syntax maybe for turing could be:

string := "hi::how::are::you"
new_array := Explode (string, new_array, "::")
/*
i'm a bit rusty with turing and php, but new_array should include:
new_array[0] := "hi"
new_array[1] := "how"
new_array[2] := "are"
new_array[3] := "you"
*/


-----------------------------------
MysticVegeta
Thu Jun 23, 2005 10:47 am


-----------------------------------
Hi, I made something similar to what you were saying, the command is ->
stringSplit (sentence, letter)

/*
 By: Tan (aka Mystic)

 For: "NEW COMMANDS FOR TURING"

 This program takes a string and splits it depending on what the splitting letter is
 You may enter any letter but if the letter is not present in the sentence, the entire sentence is the
 result. Comments are put to guide how it works.

 Usage: Many Encryption problem deal with removing spaces, and many other problems deal with removing certain characters,
 not a really necessary program but still useful sometimes.

 */

fcn stringSplit (line : string, letter : string) : string  %Creating a function that outputs the result and takes a word, and letter
    var splitter : string  % The main Answer

    for x : 1 .. length (line)               % This loop checks whether the beginning is from a space or not or the series of
        if line (x) not= letter then         % letters in the beginning
            splitter := line (x .. *)        % If it finds the non-splitter inside
            exit
        end if
    end for

    for decreasing x : length (splitter) .. 1   %Same as above loop. except this time it checks whether In the end
        if splitter (x) not= letter then        %If there are letters left
            splitter := splitter (1 .. x)
            exit
        end if
    end for

    loop %Looping untill the sentence is letter free!
        exit when index (splitter, letter) = 0  %Exits the loop, when no letters are left in the sentence
        splitter := splitter (1 .. index (splitter, letter) - 1) + splitter (index (splitter, letter) + 1 .. *) %Main splitting
    end loop %Self Explainatory (maybe =P)

    result splitter  %Resulting the answer
end stringSplit

put stringSplit ("      I    THINNNNNK IT WORKS ? ? ? ?  ASND A DAS DSDA DD A ", " ") % Well the sentences, splitting letter here.


-----------------------------------
zylum
Thu Jun 23, 2005 1:50 pm


-----------------------------------
yeah before the down time i suggested we incorperate regular expressions. its really powerful for handling strings.  you guys should check it out in other languages such as java and perl

-----------------------------------
MysticVegeta
Thu Jun 23, 2005 1:57 pm


-----------------------------------
true, my previous post's idea was based on 
string.split();
code from Java.

-----------------------------------
Jorbalax
Thu Jun 23, 2005 2:31 pm


-----------------------------------
Here's one I made today.  It's a button-switch for characters using Input.Keydown.  Normally, when you're running Input.KeyDown in a loop and you press a button, the if statement you have set for that button will continuously run as it is down.

Example Code

import Key

var input : array char of boolean

loop
Input.KeyDown (input)
if input (KEY_RIGHT_ARROW) then
Draw.FillOval (maxx div 2 - 20, maxy div 2, 20, 20, Rand.Int (1, 10))
end if

if Key.Check (input, KEY_LEFT_ARROW) then
Draw.FillOval (maxx div 2 + 20, maxy div 2, 20, 20, Rand.Int (1, 10))
end if

Key.Switch (input, KEY_LEFT_ARROW)
end loop


Thanks for the ideas, Cervantes, I'll try them.

-----------------------------------
Cervantes
Thu Jun 23, 2005 4:14 pm


-----------------------------------
What about the net commands? Can we do anything about those? Like somehow speed it up, compression maybe? Also, in PHP there is a command called "explode" which breaks up a string into an array at a certain symbal. An example syntax maybe for turing could be:

string := "hi::how::are::you"
new_array := Explode (string, new_array, "::")
/*
i'm a bit rusty with turing and php, but new_array should include:
new_array[0] := "hi"
new_array[1] := "how"
new_array[2] := "are"
new_array[3] := "you"
*/

I do not believe it is possible for a function in Turing to result an array with a dynamic upper bounds.  :(

-----------------------------------
StarGateSG-1
Thu Jun 23, 2005 5:36 pm


-----------------------------------
I looks like there are alot of nice things coming together, this is much better than I expected, I have decided that the first thing I will do is work of the GUI.SaveFile and OpenFile, but I think I might get a summer job so I will have to squeeze it in, as for the list I will add that to the forst post Token.

There will always be somethings we can't edit so we can just accpet those how they are and cervates is right we don't have to jump right on and make all these new ones we can take existing commands and edit and add to them.

-----------------------------------
[Gandalf]
Fri Jun 24, 2005 5:20 pm


-----------------------------------
Yeah, but you see, it would be hard to change some of the existing commands because they were written in other languages...

Alright, here's my meek contribution, I added to the Draw module.  Just copy the attached file to your "Turing/Support/predefs" folder and overwrite.  I assure everyone that it does not mess anything up, you can always just edit it out if you want.  Back up the original if you want, but its really not neccessary  :roll:.

Here's the syntax:
Draw.ThickOval (x, y, xRadius, yRadius, thickness, Color : int)
Draw.ThickBox (x1, y1, x2, y2, thickness, Color : int)

Oh, the Draw.ThickOval doesn't look perfectly because of the way ovals are made in Turing.  I will try to fix this later, right now I just made everything as simple as possible ;).

Right, right, and here's the attachment:

*EDIT* Alright, updated.

-----------------------------------
Cervantes
Fri Jun 24, 2005 5:42 pm


-----------------------------------
Gandalf, let's reduce the number of boxes that need to be drawn from a possibly large number (number of boxes to be drawn equals the value of thickness) to a cap of four, regardless.


    proc ThickBox (x1, y1, x2, y2, thickness, Color : int)
        Draw.FillBox (x1, y1, x1 + thickness, y2, Color)    %left side
        Draw.FillBox (x2 - thickness, y1, x2, y2, Color)    %right side
        Draw.FillBox (x1, y1, x2, y1 + thickness, Color)    %bottom
        Draw.FillBox (x1, y2 - thickness, x2, y2, Color)    %top
    end ThickBox

And as an added bonus of doing it this way, you can create a checkerboard effect by using a negative thickness.

-----------------------------------
lyam_kaskade
Fri Jun 24, 2005 7:11 pm


-----------------------------------
Couldn't you just draw two boxes?

proc ThickBox (x1, y1, x2, y2, thickness, Color : int)
    Draw.Box (x1, y1, x2, y2, Color)
    Draw.Box (x1 + thickness, y1 + thickness, x2 - thickness, y2 - thickness, Color)
    Draw.Fill (x1 + 1, y1 + 1, Color, Color)
end ThickBox


-----------------------------------
Token
Fri Jun 24, 2005 7:38 pm


-----------------------------------
you could but if ur using this over another picture and there was a line diagonally through it, only one side of the line would be filled

-----------------------------------
Cervantes
Fri Jun 24, 2005 8:03 pm


-----------------------------------
There's also the question of speed.

proc ThickBox (x1, y1, x2, y2, thickness, Color : int)
    Draw.FillBox (x1, y1, x1 + thickness, y2, Color)        %left side
    Draw.FillBox (x2 - thickness, y1, x2, y2, Color)        %right side
    Draw.FillBox (x1, y1, x2, y1 + thickness, Color)        %bottom
    Draw.FillBox (x1, y2 - thickness, x2, y2, Color)        %top
end ThickBox

proc ThickBox2 (x1, y1, x2, y2, thickness, Color : int)
    Draw.Box (x1, y1, x2, y2, Color)
    Draw.Box (x1 + thickness, y1 + thickness, x2 - thickness, y2 - thickness, Color)
    Draw.Fill (x1 + 1, y1 + 1, Color, Color)
end ThickBox2


var currentTime := Time.Elapsed
for i : 1 .. 200
    ThickBox (50, 50, 100, 100, 20, black)
end for
put Time.Elapsed - currentTime

currentTime := Time.Elapsed
for i : 1 .. 200
    ThickBox2 (50, 50, 100, 100, 20, black)
end for
put Time.Elapsed - currentTime

I dislike using Draw.Fill.

-----------------------------------
jamonathin
Fri Jun 24, 2005 8:22 pm


-----------------------------------
Hmm, valid point.  The draw fill ran 28.22 times slower on my comp.  I was trying to put together something for the drawthickoval thinger so that it wasn't so choppy, but I was using Draw.Fill, and it would have run into too many problems anyways.

-----------------------------------
[Gandalf]
Fri Jun 24, 2005 8:53 pm


-----------------------------------
Alright, I've finished my two additions to the Draw module.  Draw.ThickBox I stuck with Cervantes' way for obvious reasons.  For the Draw.ThickOval, I changed it to Draw.ThickCircle since usually we are making cirlces (ovals can be added later :)).

ThickCircle runs much slower now, but it also adds a kind of effect :).  To make the speed a bit faster when it can be I added compensation.

Well, tell me what you think, I'll add some more stuff later.

-----------------------------------
jamonathin
Fri Jun 24, 2005 9:39 pm


-----------------------------------
Interesting way to draw your circle.  To bad it only took 40 seconds to draw it on my crap ass comp.  I think the only way to do it is to Draw.Fill, but that too would slow it down.

I was thinking of changing all of Turing's Draw.Whatever where we have to input an int, if we were to change that to a real, and in the actualy command (In Draw.tu ) we were to simply round it there, saving time and trouble for the user.

-----------------------------------
[Gandalf]
Fri Jun 24, 2005 10:38 pm


-----------------------------------
Hmm, well I ran it on a Althon 64 2.8ghz and it ran pretty fast ;) took only around 1/2 seconds...  I guess I didn't really put into consideration the speed of the computer, hmm...  Actually, I have another idea *jots it down* thanks jamonathin!  I'll try it out and post it if it works.

Oh, and out of interest, what was the thickness/radius of the circle you were drawing?

I'll work on some other fixes/commands too.. I forgot to add the syntax of the  Draw.ThickCircle - its:
Draw.ThickCircle (x,y,radius,thickness,colour)
Just in case :).

-----------------------------------
wtd
Fri Jun 24, 2005 11:16 pm


-----------------------------------
If you're drawing simple geometric shapes with thickness, you may wish to add the ability for your procedure to draw one side thicker than the other.

-----------------------------------
Cervantes
Sat Jun 25, 2005 7:34 am


-----------------------------------
If you're drawing some basic shape and you can SEE it being drawn, it's too slow.  I don't think there's much we can do about drawing.
Jamonathin: That's a good idea, but keep in mind you cannot change the code for Draw.Box and others like it.  You can change the parameters, but then it doesn't work.  I suppose you could make a second procedure, but it would have to have a different name.  Too bad Turing doesn't have overloading. :wink:

-----------------------------------
Cervantes
Sat Jun 25, 2005 9:51 am

Ideas
-----------------------------------
If anyone wants any ideas for procedures/functions to code, a good place to look is the strings and arrays.

-----------------------------------
Token
Sat Jun 25, 2005 10:49 am


-----------------------------------
WOW! awsome idea Cervantes, if anyone is gonna start working on this, let me know so that i can add it to the list.

-----------------------------------
Cervantes
Sat Jun 25, 2005 12:23 pm


-----------------------------------
Here's all the methods I thought were feasible up until "s".  I'll finish them later.  I've attached it as the Str module, sorry if you prefer otherwise.  Keep in mind that you don't have to overwrite the existing Str module; you can just open file from its current location and then delete the module, export, and all the lines starting with external.

Also, Ruby's methods are interesting in that they have, as wtd calls them, "visual indicators" as to what they do.  For example, capitalize! is a procedure that will change what it is referring to.  

myString = "hello WOrld"
myString.capitalize!
puts myString


Hello world


On the other hand, you could use the function, capitalize.

myString = "hello WOrld"
puts myString.capitalize

Same output.

Similarly, Ruby has methods that end in a question mark (?) that indicate the method returns a boolean value.  Ex. empty?

I've tried to make a system that works something like this.  But, Turing will not allow is to have characters such as ! and ? as part of method names (or anything, for that matter :roll:).  So, instead of using ! at the end, I've made it Make_.  Instead of using ? at the end, I've made it Is_.

Enough talking about Ruby.  Here's the file. :)

-----------------------------------
wtd
Sat Jun 25, 2005 1:16 pm


-----------------------------------
Instead of "make", how about "modify"?

-----------------------------------
[Gandalf]
Sat Jun 25, 2005 1:45 pm


-----------------------------------
Amazing!  Some of that stuff is really useful, great idea to take stuff from other languages :).  Ruby seems pretty great.

Here are two really simple things I added to the Math module.  CircleArea and Slope.  Slope is just basic, and it doesn't give the answer in fraction form even though that's how you usually need it for school?

    %
    % Calculate the slope between two points.
    % By: 

-----------------------------------
Token
Sat Jun 25, 2005 3:12 pm


-----------------------------------
hey gandalf, yah its okay that its not in fraction format, it is just over 1 so if it returned 1.5 for the slope its 1.5/1, and hate to break it to yah, lol its already in the new module, umm and i'll add in the Circle one right now. could u please make a help file for the circle one for me and send it over? (using the template I sent). thanks alot, keep em coming guys

Cervantes: yah (as the e-mail said) we'd prefer it in a separate module. if u dont feel like separating them (i wouldent blame you) just let me know which commands you added and then i'll do it, if u do separate it add it to AdvStr or somthin. thx alot

-----------------------------------
Bacchus
Sat Jun 25, 2005 3:20 pm


-----------------------------------
Gandalf, your ThickCircle draws a bit slowly... I looked at it and didn't figure out why you did some things.. also it can't make Ovals. So here try this:
proc ThickOval (x, y, xr, yr, thickness, c : int)
    for i : 1 .. 360
        Draw.FillOval (round (x + (cosd (i) * xr)), round (y + (sind (i) * yr)), thickness, thickness, c)
    end for
end ThickOval

-----------------------------------
MysticVegeta
Sat Jun 25, 2005 3:45 pm


-----------------------------------
eh?
proc ThickFillOval (x, y, xr, yr, thickness, ct, cm : int)
    drawoval (x, y, xr, yr, 255)
    for s : 1 .. thickness
        drawoval (x, y, xr + s, yr + s, 255)
        drawoval (x, y, xr - s, yr - s, 255)
    end for
    drawfilloval (x, y, xr - 1, yr - 1, cm)
end ThickFillOval

ThickFillOval (maxx div 2, maxy div 2, 50, 50, 3, 255, brightred)


-----------------------------------
[Gandalf]
Sat Jun 25, 2005 3:45 pm


-----------------------------------
Thanks Bacchus!

Token, I think you're missing the point.  It's better to have it already in the module if there is a coresponding one, and if its some totally new idea (we don't have a lot of those) then we can make a new module.  I am strongly inclined to keep the new commands in the already existing modules.  Also, I didn't know somebody was working on Math, but that's alright.

Do you need a helpfile for Draw.ThickCircle and Draw.ThickBox too?

*EDIT* What's that MysticVegeta?  It doesn't work good at all :?.  The thing we are trying to eliminate is the white spots in the actual circle.  We are also avoiding using drawfill* because of speed.

Oh, wait - I noticed the Draw.ThickFILLOval.  Thanks for the contribution, but try to get rid of the white spaces.

-----------------------------------
Token
Sat Jun 25, 2005 3:49 pm


-----------------------------------
alright, i guess we'll put them in their respective modules, but we have to make sure that when we are done the func you fill out a help file. that way we dont miss anything. so yes please fill out a help file, they take 5-10 minutes each so its not that big of a deal

-----------------------------------
wtd
Sat Jun 25, 2005 3:59 pm


-----------------------------------
"]Amazing!  Some of that stuff is really useful, great idea to take stuff from other languages :).  Ruby seems pretty great.

So, just use Ruby.  :P

-----------------------------------
MysticVegeta
Sat Jun 25, 2005 4:03 pm


-----------------------------------
"]Thanks Bacchus!

Token, I think you're missing the point.  It's better to have it already in the module if there is a coresponding one, and if its some totally new idea (we don't have a lot of those) then we can make a new module.  I am strongly inclined to keep the new commands in the already existing modules.  Also, I didn't know somebody was working on Math, but that's alright.

Do you need a helpfile for Draw.ThickCircle and Draw.ThickBox too?

*EDIT* What's that MysticVegeta?  It doesn't work good at all :?.  The thing we are trying to eliminate is the white spots in the actual circle.  We are also avoiding using drawfill* because of speed.

Oh, wait - I noticed the Draw.ThickFILLOval.  Thanks for the contribution, but try to get rid of the white spaces.

oh lol. I am not really good at understanding trignometry yet, so i made it according to my simplycity lol.

-----------------------------------
[Gandalf]
Sat Jun 25, 2005 4:19 pm


-----------------------------------
wtd, I know, but well... I might some time soon.  I have to make my decision betweem Java(school),C++, or Ruby.

Simplicity is best! (usually, someone please don't get into an argument with me about this :lol:)

Here you go Token, this is the Draw.ThickBox helpfile attached.

Also, I was looking around the other predefs/modules are here are some stuff I found/thought about:

--The limits.tu file, we could probably change that around.  Not sure if changing the maximum supported integer would cause too many problems.

--Maybe we could export pi and e from Math.tu and make them global constants.

--Something interesting, for old commands like randseed it automatically changes them to things like Rand.Seed, so there really is no difference.

--Somebody could try 'unofficially' adding support for .gifs?  It would be pretty useful.

--We could add some more general colours to the RGB module, like "gold" and stuff like that.

--There's an experimental View.Scroll command, maybe someone could figure it out and complete it?

Yeah, those are some ideas I came up with :).

-----------------------------------
MysticVegeta
Sat Jun 25, 2005 4:49 pm


-----------------------------------
Ah the fraction reducer, i found the CCC problem i coded and turned it into a module

/*
 Created by: Tan (aka Mystic)
 Module fraction.Reduce takes a fraction in a*b/c format and reduces it to lowest terms
 */

module fraction %%% MODULE

    export Reduce

    proc Reduce (whole : int, numerator : int, denominator : int) %%% 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 := "Reduced Fraction: " + intstr (whole) + " " + intstr (numerator) + "/" + intstr (denominator) + " into: \n" + 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 := "Reduced Fraction: " + intstr (whole) + " " + intstr (numerator) + "/" + intstr (denominator) + " into: \n" + intstr (num div numorden) + "/" + intstr (den div numorden)
            elsif den < num then
                %% IF IT CAN BE REDUCED, EXPRESS IT AS A MIXED FRACTION
                ans := "Reduced Fraction: " + intstr (whole) + " " + intstr (numerator) + "/" + intstr (denominator) + " into: \n" + 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

        put ans %% PUTTING THE MAIN ANSWER WE GOT

    end Reduce %% ENDING THE REDUCE

end fraction %% ENDING THE MODULE

fraction.Reduce (5, 45, 3) %% HERE 0 IS THE WHOLE NUMBER, 3 IS THE NUMERATOR, 2 IS THE DENOMINATOR


-----------------------------------
Token
Sat Jun 25, 2005 5:06 pm


-----------------------------------
amazing! its in, umm and as to gandolf, heres the list with ur sudgestions added, and thanks for the help file.



Here is the list so far. 

1	Rotated draw oval 
2	3D box 
3	GUI 
4	Thick basic shapes 
5	Pic.Opacity 
6	Triangles 
7	Array average 
8	Better sprites 
9	Music player 
10	Array Shuffle (2d arrays) 
11	Draw line that works off slope 
12	String split
13	Button -switch for characters using Input.Keydown 
14	Message Prompt
15	Limits? (if someone could look into this I'd appreciate it)
16	Gif Support
17	More Colors 
18	View.Scroll
19	LCD (lowest common denominator)
20	Lowest terms - completed
21	Slope Func  - Completed
22	 Isint- Checks to see if a real number is whole (int) - completed
23	Shake Screen - completed


I'll add the help file and post the help file so that you can see how it turns out.

-----------------------------------
wtd
Sat Jun 25, 2005 5:10 pm


-----------------------------------
What about having a Fraction type and then defining operations for it?

type Fraction :
   record
      numerator, denominator : int
   end record

function makeFraction (num, denom : int) : Fraction
   var output : Fraction
   output.numerator := num
   output.denominator := denom
   result output
end makeFraction

function reduce (f : Fraction) : Fraction
   if f.numerator mod f.denominator == 0 then
      result makeFraction (f.numerator div f.denominator, 1)
   else
      ...
   end if 
end reduce

-----------------------------------
[Gandalf]
Sat Jun 25, 2005 5:16 pm


-----------------------------------
Nice, do you want to create a whole module for fractions or add it on to the Math one, for something like Math.FractionReduce.  I'd probably just do that.

Here's a new Font module.  I added Font.Centre.  There's a help file too.

Here's an example program using it:
setscreen ("graphics:max;max")
var exampleFont : int := Font.New ("Times:100:bold,italic")
Font.Centre ("Gandalf", maxx div 2, maxy div 2, exampleFont, green)

Oh, and are you going to add all these help files to the current one, or are you going to have to have two seperate ones?

-----------------------------------
Cervantes
Sat Jun 25, 2005 5:22 pm


-----------------------------------
"]
    %
    % Calculate the slope between two points.
    % By: 
Gandalf, those functions could be reduced to one line:

result (y2 - y1) / (x2 - x1)

Similarly for CircleArea.
Also note I used y2 - y1 and x2 - x1, not the reverse.  It doesn't change the final result, but it's generally preferred to avoid working with negatives.  Of course, it's not like the computer cares.

CircleArea is a bit restricted.  Let's expand it to ellipses, specified by the bottom left corner at (x1, y1) and the top right corner at (x2, y2).


function EllipseArea (x1, y1, x2, y2 : real) : real
    result Math.PI * abs ((x2 - x1) / 2) * abs ((y2 - y1) / 2)
end EllipseArea


I don't think there's any way to add things into the main Help file.

-----------------------------------
[Gandalf]
Sat Jun 25, 2005 5:25 pm


-----------------------------------
Alright, thanks Cervantes, I'm not used to writing funtions.  I was thinking something along the lines of decompiling the windows help file, editing the html, and then compiling it?  Not sure if its possible though.

Ohhhh, and I didn't realize/forgot that that PI variable is already exported.  That's what is called when you do Math.PI  :doh:

-----------------------------------
Cervantes
Sat Jun 25, 2005 5:33 pm


-----------------------------------
Yep.  Same with e, I believe.

Decompiling the windows help file, editing the html, and recompiling it?  Well... How do you decompile it?  And it's not the windows help file that we're looking to edit.  How do you know it's in html?  Seems kinda strange to me.

-----------------------------------
wtd
Sat Jun 25, 2005 5:35 pm


-----------------------------------
"]Nice, do you want to create a whole module for fractions or add it on to the Math one, for something like Math.FractionReduce.  I'd probably just do that.

Oh, I have no desire to write it all myself.  Just giving someone else a push in the right direction.

Oh, and if you're going to take a page from Ruby's book, learn this: synonyms can be very good.  Feel free to have "Font.Centre", bt then also have "Font.Center" which does the same thing.

-----------------------------------
[Gandalf]
Sat Jun 25, 2005 5:54 pm


-----------------------------------
Alright, where do I begin...
Decompiling the windows help file, editing the html, and recompiling it?  Well... How do you decompile it?  And it's not the windows help file that we're looking to edit.  How do you know it's in html?  Seems kinda strange to me.
I'm not sure how you decompile it, which is why I'm not sure it's possible.  I realize that its not the windows help file we're editing :), I meant that its a windows-form help file.  I know it's html because it that's what help files are written in, chm stands for compiled html (I think).
http://img117.echo.cx/img117/9822/helpfile9zf.jpg

Oh, I have no desire to write it all myself. Just giving someone else a push in the right direction.

Oh, and if you're going to take a page from Ruby's book, learn this: synonyms can be very good. Feel free to have "Font.Centre", bt then also have "Font.Center" which does the same thing.
Sorry, I was talking to MysticVegeta, because he made his procedure a whole module.  I didn't even see your post when I made mine - it took a while :).

Alright, I'll add the other spelling of centre/center, and I'll watch out for it in the future, thanks.

-----------------------------------
Token
Sat Jun 25, 2005 5:57 pm


-----------------------------------
Gandalf: thats kinda what i'm doing, i'm making my own helpfile with the same software so i can just integrate it easily after

-----------------------------------
[Gandalf]
Sat Jun 25, 2005 6:01 pm


-----------------------------------
Yes, but just how are you going to integrate it?  It would be really cool if you could access the new help files from the F9 help menu.

-----------------------------------
Token
Sat Jun 25, 2005 6:02 pm


-----------------------------------
its all in that software, it can be done.  :lol:

-----------------------------------
[Gandalf]
Sat Jun 25, 2005 6:07 pm


-----------------------------------
Ok, so you're going to decompile it somehow, and add the example to the "examples" folder, then add the loopup command to "Keyword Lookup.txt", right?  Also, what is this magical software?

*This is in no way spam or off topic, I'm just tired from writing Turing :P*

-----------------------------------
Token
Sat Jun 25, 2005 6:15 pm


-----------------------------------
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 :P btw go on ICQ so that we dont have to keep chatting over the forum  :roll:.

-----------------------------------
Token
Sat Jun 25, 2005 6:19 pm


-----------------------------------
New Commands 

Draw
	ThickOval
	ThickBox
	Box3D
	FillBox3D
Math
	Slope
	Isint
	Circlearea
Screen
	Shake
Str 
	??
	Split
Array                         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
Sat Jun 25, 2005 7:40 pm


-----------------------------------
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
Sat Jun 25, 2005 7:50 pm


-----------------------------------
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

-----------------------------------
jamonathin
Sat Jun 25, 2005 8:00 pm


-----------------------------------
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: _____ Jamonathin =   :mrgreen:

Looking pertsy goods though.  It looks all official and stuff

-----------------------------------
[Gandalf]
Sat Jun 25, 2005 8:47 pm


-----------------------------------
2. Jamonithin = Evil or Very Mad _____ Jamonathin = Mr. Green 
:lol:

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:

-----------------------------------
StarGateSG-1
Sat Jun 25, 2005 9:01 pm


-----------------------------------
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
Sat Jun 25, 2005 9:08 pm


-----------------------------------
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
Sun Jun 26, 2005 12:24 am


-----------------------------------
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
Sun Jun 26, 2005 12:26 am


-----------------------------------
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
Sun Jun 26, 2005 9:04 am


-----------------------------------
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?  :lol:  or anyone really for that matter :?:

-----------------------------------
MysticVegeta
Sun Jun 26, 2005 9:06 am


-----------------------------------
hehehe, messing with the assembly after unpacking turing lol.  :lol:

-----------------------------------
MysticVegeta
Sun Jun 26, 2005 9:10 am


-----------------------------------
on topic : hey, you know i think alikhan made a base converter, maybe we can make commands for logrithmic functions.  :wink:

-----------------------------------
Token
Sun Jun 26, 2005 9:11 am


-----------------------------------
see the thing i just realized is that there is no question of legality with adding to the turing predefs, but once we start unpacking the main .EXE for the entire program... i'm no lawyer but that may be a little risky.

-----------------------------------
MysticVegeta
Sun Jun 26, 2005 9:19 am


-----------------------------------
I think as long as we can unpack exe and keep it to ourself and not distribute then it may be legal but i think i will need more research on the laws of Holtsoft.

Ontopic: I was thinking maybe of making a command that factors a quadratic equation. Math.quadraticFactor(1, 2, 3) 
that is - 1x^2 + 2x + 3
eh?

-----------------------------------
Cervantes
Sun Jun 26, 2005 9:37 am


-----------------------------------
Frankly, I think a lot of these functions are quite useless, or very near to it.  Really, look at that Ruby page and find something to code that is useful.  No offense meant, Mystic.

-----------------------------------
MysticVegeta
Sun Jun 26, 2005 9:50 am


-----------------------------------
oh lol i am really into it. lol. 
I think the quadratic is useless but the logrithmic functions are quite usefull.

-----------------------------------
[Gandalf]
Sun Jun 26, 2005 4:05 pm


-----------------------------------
Yeah, once you think about it, when you make functions like CircleArea (as an example from me) you're not making anything easier.  Your just taking away from the fact that the programmer actually had to think while programming.  Still, I guess we'll keep it for now.

As for unpacking the .exe, well, you can look at it from a hex editor - that could allow you to change some basic stuff.  You could also resource hack it, but again, that doesn't allow you to change the actual C++ code.  What I looked at yesterday was a file called: Turing.pdb in the support/bin folder.  I know that .pdb files are Microsoft C/C++ program database 2.00.  What I found out you can do is extract this database.  This is some of what I got:
http://img212.echo.cx/img212/7461/extractresults6hw.jpg
Maybe someone with more knowledge on the matter can tell us more?

If there are any implications of this that I should be warned about, feel free to :).

-----------------------------------
wtd
Sun Jun 26, 2005 6:17 pm


-----------------------------------
The only C++ aspect to this is that structs live in the main namespace.  In other words, you can write:

Foo* bar;

Rather than:

struct Foo* bar;

The rest is pure C, taking no advantage of C++'s advantages.  And with types like DWORD, it's no wonder Turing isn't portable.

-----------------------------------
StarGateSG-1
Mon Jun 27, 2005 10:52 am


-----------------------------------
For the record, we don't have to stop at just adding new commands, we could come out with our version completely, we can use hex editor and reshacker to do work on it. This is becasue Holt won't include our idea's becasue they want to keep everything thmeselves, including credit!!! So now i

-----------------------------------
[Gandalf]
Mon Jun 27, 2005 4:06 pm


-----------------------------------
Have you contacted them or something?  Or is this just what you think will happen?  Besides, hex editing it won't really change anything, only some basic messages that it gives.  Resource hacking it will allow us to change the icon and some of the menus and forms, maybe some messages too.  Doing that could also cause legal problems which you would have to look into.

Also, why is your message cut off?

-----------------------------------
StarGateSG-1
Mon Jun 27, 2005 4:32 pm


-----------------------------------
I didn;t cut off my message, and there are some programs that can open up more than a basic hex editor, the reshacker well it can do what you said, and we can aviod legal issue's of we give them full credits for everything they did and keep it non porfit, and we can't distribed it unless they get something for i.e The 80 $ or so it costs, so you have to own turing to use nayhting we make that is all. I am going to double check that know, I am going to read the user agreements.
TO answer your first question, that is thier non-Offical answer, that doesn't mean it can;t happen that is there support answer, I am still waiting for a return from Tom West whoc an override. I am trying to keep the updates coming.

-----------------------------------
[Gandalf]
Mon Jun 27, 2005 4:41 pm


-----------------------------------
I see, well, at least wait for some official answer.  If we start editing their client and everything then they might not want to support us anymore.  Like I said before, we can try dumping all the contents of the .pdb file, edit it, and make a new one somehow.  The only other thing I can think of is actually decompiling the .exe and then editing the assembly (I think it is, not sure though) or else converting it to something else, like C/C++.

The problem is though that even then we would need knowledge of C/C++ or Assembly.  I think we should continue as we were and wait a bit.  Start simple, then if it turns out good, improve the ideas and go more complex.

-----------------------------------
wtd
Mon Jun 27, 2005 6:48 pm


-----------------------------------
If you try to reverse engineer the existing interpreter, you'll likely get into legal trouble.  If you were to create your own implementation from the ground up, with no knowledge of how exactly Holtsoft built the current Turing interpreter, you probably wouldn't have too much trouble.

Of course, the other option is to kick the habit and embrace something non-proprietary that doesn't require you to jump through so many hoops.

-----------------------------------
Jorbalax
Wed Jun 29, 2005 1:07 pm


-----------------------------------
I'm inclined to agree with wtd...so long Turing, hello C++!

Someone else can take up where I left off if they want.

-----------------------------------
Bacchus
Wed Jun 29, 2005 11:21 pm


-----------------------------------
Ok, I don't know about hacking Turing or making a new language or switching to C++, but before there was talk abot making an Ellipse. Here's my shot at it, kind of works kind of not, lol
View.Set ("graphics:200;200,offscreenonly,position:center,middle,nobuttonbar")

proc ellipse (x, y, xh, yh, angle, c : int)
    for i : 1 .. 360
        Draw.Dot (x + round ((cosd (i - angle) * xh)), y + round ((sind (i) * yh)), c)
    end for
end ellipse

for i : 1 .. 360
    cls
    ellipse (100, 100, 70, 50, i, 2)
    put "Angle:",i
    View.Update
    delay (10)
end for  Have Fun :)

-----------------------------------
Delos
Thu Jun 30, 2005 3:05 pm


-----------------------------------
Just dropping by for a bit...

"]How about something like Pic.Fade or Pic.Opacity.  Then you could have the syntax like this:
Pic.Opacity(picID, opacity) %or maybe
Pic.Opacity(picID,opacity,backgroundcolour)

3d box thing is really good.

Opacity can be achieved through my on topic : hey, you know i think alikhan made a base converter, maybe we can make commands for logrithmic functions.  :wink:
Base converter:  quick method to switch between bases is to use intstr()!  Check it out under F10.
Logs:  well, we have ln() so we can always do something like 'ln(3)/ln(10)' to get to log.

-----------------------------------
jamonathin
Fri Jul 01, 2005 9:24 pm


-----------------------------------
I have an idea for a new Command.  Some of you probabily already know this, but may have forgotten about it.  Have you ever got the error mesage?:


Complex multi-dimensioned flexible array reallocation not implemented yet - sorry.

I'm not entirely sure if we can even do this without making an entirely new variable, but, just an idea  :? .

var error : flexible array 1 .. 7, 1 .. 7 of int
new error, 2, 1


It doesn't make sense to me why they would go about telling you how to change a multi-dimensioned flexible array, without the program being able to do it.

-----------------------------------
Bacchus
Fri Jul 01, 2005 11:11 pm


-----------------------------------
Take a look at the Flexible Array Tutorial by Cervantes, its doesnt work the best, but you can resize multi-dimensional flexible arrays. If you really wanted to, you could even look up the old thread that inspired the edit into that Tutorial.

-----------------------------------
Cervantes
Mon Jul 04, 2005 2:43 pm


-----------------------------------
Here's the finished Str module.  I think I only added one or two new functions, since a lot of them I can't do (they use blocks, or return an array with a dynamic upper bounds, or maybe some other things Turing can't do).

Is someone going to tackle the Array module?  I have a feeling a lot of the methods can't be translated into Turing (mostly because of blocks and an unknown upper bounds) so it shouldn't be too daunting a task.  :)

-----------------------------------
jamonathin
Wed Jul 06, 2005 11:35 pm


-----------------------------------
I was juss screwin around with Turing's RGB thinger, and I came up with this little tool.  I figured I'd post a demo of it before making a big deal about it, seeing as it may not be good enough for our lil update, but here it is.

It just asks the user to input 2 colors and it creates a shaded image of it between the two colors.  Click the mouse somewhere.

P.S - good job on the str. mod.
setscreen ("graphics:max;max,nobuttonbar")
colorback (black)
cls
var mx, my, mz : int

procedure ShadeOval (x, y, a, b, c1, c2 : int)
    var high : int
    if a > b then
        high := a
    elsif b > a then
        high := b
    else
        high := a
    end if
    var r, g, bl : array 1 .. 2 of real
    RGB.GetColor (c1, r (1), g (1), bl (1))
    RGB.GetColor (c2, r (2), g (2), bl (2))
    var C : int
    var dr, dg, db : real
    dr := (r (1) - r (2)) / high
    dg := (g (1) - g (2)) / high
    db := (bl (1) - bl (2)) / high
    for decreasing i : high .. 2
        r (2) += dr
        g (2) += dg
        bl (2) += db
        C := RGB.AddColor (r (2), g (2), bl (2))
        drawfilloval (x, y, round (a * (i / high)), round (b * (i / high)), C)
    end for
end ShadeOval

loop
    mousewhere (mx, my, mz)
    if mz = 1 then
        ShadeOval (mx, my, 15, 15, yellow, black)
    end if
end loop



-----------------------------------
MysticVegeta
Thu Jul 07, 2005 11:29 am


-----------------------------------
Nice! That looks pretty cool, looks like an oval gradient, good job  :)

-----------------------------------
StarGateSG-1
Mon Jul 11, 2005 3:58 pm


-----------------------------------
I don;t know if anyoen noticed this but Draw.ThinkLine already existed??, I haven been away and AM not sure if thsi was brought up??

-----------------------------------
[Gandalf]
Mon Jul 11, 2005 5:44 pm


-----------------------------------
Yes, it already existed although it was not officially supported.  We did not add any Draw.ThickLine - but that's what I got the idea from to make 'thick' shapes.

Really nice 'oval gradient'!  Good for making graphics on Turing.  Only thing I would try to fix is the constant black outline around it - makes it look a bit worse.

-----------------------------------
jamonathin
Tue Jul 12, 2005 2:00 am


-----------------------------------
what black line are you talking about [Gandalf]?  I checked it out on different colored backgrounds, with  different oval color, and still nothing. :think:

-----------------------------------
Shyfire
Tue Jul 12, 2005 2:04 pm

fullscreen???????????????????????/
-----------------------------------
k iv got an  idea :idea: how about editing the window module to have a fullscreen function

-----------------------------------
MysticVegeta
Tue Jul 12, 2005 3:35 pm


-----------------------------------
Thats not possible because turing cannot interact with Windows API.

-----------------------------------
Shyfire
Tue Jul 12, 2005 3:54 pm


-----------------------------------
o ic well there goes that idea    :(   :cry:   :(   :cry:   :(   :cry:

-----------------------------------
[Gandalf]
Tue Jul 12, 2005 6:57 pm


-----------------------------------
Well, see at the attachment, how there is always a black outline (not line :)) wherever a cirlce overlaps?  That's what would happen if there was a, say red background too.

-----------------------------------
jamonathin
Wed Jul 13, 2005 1:53 pm


-----------------------------------
That's because that's the first (largest) oval being drawn, which is the second color (last value in command).  What the command does is, it asks for two colors, and draws the fade between them.  
See, what my first idea was, was to have the oval fade into whatever color the background was, but then there would be some screwups with Pic.Draw's and whatnot, and originality of the oval.  So I just had the user pick whatever two colors they wanted the ball to be.  So, are you saying have the 'yellow' fade into whatever whatdotcolor is behind the oval?

-----------------------------------
[Gandalf]
Wed Jul 13, 2005 6:18 pm


-----------------------------------
Yep.  You could just have two different commands or something.  I'm not sure how it would mess anything up, I didn't look at the code, but the idea I had of this is having it slowly fade into the background.  It's up to you and either way it works pretty good.

-----------------------------------
jamonathin
Wed Jul 13, 2005 10:14 pm


-----------------------------------
Well firstly, I meant the background at first was a problem, because sometimes when I make a program, my background color is green or something, and I have pictures drawn on top of the background that don't relate to green whatsoever.  And always making the circle draw with the background color could make the proggy look ugly.

But if we were to draw a circle like such, we could compare every color in the background with the circle
proc circle (c : int)
    for a : 0 .. 360
        for i : 1 .. c
            drawdot (round (100 + sin (a) * i), round (100 + cos (a) * i), black)
        end for
    end for
    drawdot (100, 100, black)
end circle

circle (20)

And then we can incorporate our RGB thinger.
proc circle (c, X : int)
    var res : array 1 .. 360, 1 .. c of int
    var r, g, b : array 1 .. 2 of real
    var C : int
    for d : 1 .. 2
        for a : 1 .. 360
            for i : 1 .. c
                if d = 1 then
                    C := whatdotcolor (round (maxx div 2 + sin (a) * i), round (maxy div 2 + cos (a) * i))
                    RGB.GetColor (C, r (1), g (1), b (1))
                    RGB.GetColor (X, r (2), g (2), b (2))
                    res (a, i) := RGB.AddColor ((r (1) + r (2)) / 2, (g (1) + g (2)) / 2, (b (1) + b (2)) / 2)
                else
                    drawdot (round (maxx div 2 + sin (a) * i), round (maxy div 2 + cos (a) * i), res (a, i))

                end if
            end for
        end for
    end for
    C := whatdotcolor (maxx div 2, maxy div 2)
    RGB.GetColor (C, r (1), g (1), b (1))
    RGB.GetColor (X, r (2), g (2), b (2))
    var BLAAAAAAAAH : int := RGB.AddColor ((r (1) + r (2)) / 2, (g (1) + g (2)) / 2, (b (1) + b (2)) / 2)
    drawdot (maxx div 2, maxy div 2, BLAAAAAAAAH)
end circle
setscreen ("graphics:300;200,nobuttonbar,position:center;center")
for i : 1 .. 1000
    drawfilloval (Rand.Int (0, maxx), Rand.Int (0, maxy), Rand.Int (5, 20), Rand.Int (5, 20), Rand.Int (1, 6))
end for
circle (20, black)

But now that we have that, try changing the 20,black to 200, black. Looks kinda cool, but wont work.  

I first I thought I knew what you were saying, and now i forgot, so this is all I have lol.   :? Not sure where to go after this.
