Computer Science Canada

New Commands for Turing

Author:  StarGateSG-1 [ Mon Jun 20, 2005 5:07 pm ]
Post subject:  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)

Author:  GlobeTrotter [ Mon Jun 20, 2005 8:35 pm ]
Post subject: 

tan and tand

Author:  Bacchus [ Mon Jun 20, 2005 9:19 pm ]
Post subject: 

Get a newer version of Turing Razz
4.0.5 wrote:
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.

4.0.5 wrote:
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.

Author:  StarGateSG-1 [ Mon Jun 20, 2005 10:10 pm ]
Post subject: 

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.

Author:  GlobeTrotter [ Mon Jun 20, 2005 10:51 pm ]
Post subject: 

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.

Author:  StarGateSG-1 [ Tue Jun 21, 2005 2:05 am ]
Post subject: 

ummm be more clear, do you mean 3-D??

Author:  Bacchus [ Tue Jun 21, 2005 6:12 am ]
Post subject: 

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.

Author:  StarGateSG-1 [ Tue Jun 21, 2005 11:31 am ]
Post subject: 

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.

Author:  [Gandalf] [ Tue Jun 21, 2005 11:41 am ]
Post subject: 

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'.

Author:  StarGateSG-1 [ Tue Jun 21, 2005 11:47 am ]
Post subject: 

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.

Author:  MysticVegeta [ Tue Jun 21, 2005 12:28 pm ]
Post subject: 

Can the oval thingy not be done by looping arcs? Thinking

Author:  StarGateSG-1 [ Tue Jun 21, 2005 1:58 pm ]
Post subject: 

Maybe Like I said in other post i need people to help me before I can move on. Brainstorming will Have to wait.

Author:  lyam_kaskade [ Tue Jun 21, 2005 3:53 pm ]
Post subject: 

MysticVegeta wrote:
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:

code:

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) <= size then
                Draw.Dot (i, j, col)
            end if
        end for
    end for
end ellipse


where (X,Y) and (X2, Y2) are the focii of the ellipse, and size is the size of the ellipse.
[/quote]

Author:  Jorbalax [ Tue Jun 21, 2005 4:20 pm ]
Post subject: 

Hmm...
Here's a simple one, to start;

Draw.Thick(Oval/Box/...) (x, y, xradius, yradius, thickness, color : int)
- Draws a shape with a thick borderline.

Author:  jamonathin [ Tue Jun 21, 2005 4:41 pm ]
Post subject: 

Here, I juss whipped together a Box3D and FillBox3D program. The way I did the FillBox3D may not of been the easiest, and by all means, edit it.

Its too long to post code cuz I put a demo with it.

Heres basically what it is

Poly.Box3D (x1, y1, x2, y2, x-dist [3d], y-dist [3d], color)
Poly.FillBox3D (x1, y1, x2, y2, x-dist [3d], y-dist [3d], colorfill, colorlines)

Author:  Token [ Tue Jun 21, 2005 5:16 pm ]
Post subject: 

Thats amazing! I really want to help but I need ideas and my brain is drained from exams right now, i'll work on it a but tonight and then thursday is my last one so i'll be able to give it more focus

Author:  StarGateSG-1 [ Tue Jun 21, 2005 8:18 pm ]
Post subject: 

That is great, See that is what I am looking for with this. Keep it up. Don't worry about not helping, I will have the starting later this month so people can finish exams.

Author:  jamonathin [ Tue Jun 21, 2005 9:11 pm ]
Post subject: 

StarGateSG-1 wrote:
Don't worry about not helping.

lol, im not sure what you mean by that. At first I thought it was sarcastic, then I read it over and saw that it's a double negative, so it's like saying.
"Worry about helping".
But then I starting thinking of it as lets just hold off till the end of the month so we can be more organized without exams in the way (like you said)

. . . I think all that english bull**** those damn teachers were trying to click into me are hitting at the wrong time . . .

Author:  StarGateSG-1 [ Wed Jun 22, 2005 8:39 am ]
Post subject: 

what else can I say Lol, nice rant - I think??

Author:  ZeroPaladn [ Wed Jun 22, 2005 9:46 am ]
Post subject: 

i was reading about the oval drawn, can't you do this simply by rotating an oval?

Author:  Cervantes [ Wed Jun 22, 2005 10:01 am ]
Post subject: 

As in, Pic.New, then Pic.Rotate? Seems like unnecessary processing, to me. But still, any Draw.Fill types that we make are bound to be slow, because they must either be done with lots of drawdots, or make an outline of drawlines and then do a drawfill.

Author:  [Gandalf] [ Wed Jun 22, 2005 11:18 am ]
Post subject: 

How about something like Pic.Fade or Pic.Opacity. Then you could have the syntax like this:
code:
Pic.Opacity(picID, opacity) %or maybe
Pic.Opacity(picID,opacity,backgroundcolour)


3d box thing is really good.

Author:  Token [ Wed Jun 22, 2005 12:46 pm ]
Post subject: 

maybe a simple little thing that finds the average of an array

k so to sum up this thread and the other one, this is what we've got so far

Quote:

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
LCD (lowest common denomonator)


if u have any to add to this copy and paste the list and add whatever it is you have to offer to the bottom, try to keep this list as current as possible, or maybe even post it at the beginning of this thread StarGate

Edit:thanks Jorbalax for clarifying the shuffle one

Author:  Jorbalax [ Wed Jun 22, 2005 2:01 pm ]
Post subject: 

I plan to add on to ArrayShuffle, by including the commands to shuffle two dimensional arrays.

Author:  zylum [ Wed Jun 22, 2005 2:09 pm ]
Post subject: 

im working on a really user friendly 3d class but the only drawback is that it will use lots of classes and stuff so it wont be as fast as my optimized 3d engine... also, should it read .raw files or .ply files? i would prefer ply files because of speed issues. if i were to read .raw files i would convert them to ply anyways for speed bonuses but loading times would be dramatically increased (loading times of models)

Author:  Drake [ Wed Jun 22, 2005 5:39 pm ]
Post subject: 

Definetly the GUI. I'm still angry about not being able to use any of the GUI.Alerts. Which ones are you working on first, anyway?

Author:  Token [ Wed Jun 22, 2005 5:52 pm ]
Post subject: 

It all depends on who wants to work on which ones first

i'm working on the bold basic shapes, at the moment and also the triangle one. most of them have creators working on them right now, other than the ones i mentioned like slope, lowest common denomintator... actually i think i'll take the 5 minutes out of my time to do slope right now Laughing but the thing is if were going to do math, we cant add to the Math module that holtsoft made, we'd have to name it somthing like AdvMath or somthin

so most of them have people working on them, although GUI dosent, i dont think

Author:  [Gandalf] [ Wed Jun 22, 2005 6:23 pm ]
Post subject: 

Hehe, we could always go GR9Math.Slope Very Happy. Actually I was thinking more along the lines of maybe Math2 or something like that. "Advanced" is relative.

Here's another suggestion:
create a cfor command or something like that. I really hate it when you have to do something longer than it should be to change a for loop to go back down or up (decreasing command-like).
like when you have
code:

proc checksomething
   if blah > 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 Confused. I'll have to think on it more later.

Syntax would be:
code:
cfor(up/down,forID,startnum,endnum)

Author:  Cervantes [ Wed Jun 22, 2005 8:13 pm ]
Post subject: 

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:

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

Author:  Token [ Wed Jun 22, 2005 8:21 pm ]
Post subject: 

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

Author:  Cervantes [ Wed Jun 22, 2005 8:36 pm ]
Post subject: 

Token wrote:
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!! Very Happy

Author:  36002 [ Thu Jun 23, 2005 7:52 am ]
Post subject: 

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:
code:

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"
*/

Author:  MysticVegeta [ Thu Jun 23, 2005 10:47 am ]
Post subject: 

Hi, I made something similar to what you were saying, the command is ->
stringSplit (sentence, letter)

code:
/*
 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.

Author:  zylum [ Thu Jun 23, 2005 1:50 pm ]
Post subject: 

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

Author:  MysticVegeta [ Thu Jun 23, 2005 1:57 pm ]
Post subject: 

true, my previous post's idea was based on
code:
string.split();

code from Java.

Author:  Jorbalax [ Thu Jun 23, 2005 2:31 pm ]
Post subject: 

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
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.

Author:  Cervantes [ Thu Jun 23, 2005 4:14 pm ]
Post subject: 

36002 wrote:
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:
code:

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. Sad

Author:  StarGateSG-1 [ Thu Jun 23, 2005 5:36 pm ]
Post subject: 

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.

Author:  [Gandalf] [ Fri Jun 24, 2005 5:20 pm ]
Post subject: 

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 Rolling Eyes.

Here's the syntax:
code:
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 Wink.

Right, right, and here's the attachment:

*EDIT* Alright, updated.

Author:  Cervantes [ Fri Jun 24, 2005 5:42 pm ]
Post subject: 

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.

code:

    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.

Author:  lyam_kaskade [ Fri Jun 24, 2005 7:11 pm ]
Post subject: 

Couldn't you just draw two boxes?
code:

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

Author:  Token [ Fri Jun 24, 2005 7:38 pm ]
Post subject: 

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

Author:  Cervantes [ Fri Jun 24, 2005 8:03 pm ]
Post subject: 

There's also the question of speed.
code:

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.

Author:  jamonathin [ Fri Jun 24, 2005 8:22 pm ]
Post subject: 

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.

Author:  [Gandalf] [ Fri Jun 24, 2005 8:53 pm ]
Post subject: 

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 Smile).

ThickCircle runs much slower now, but it also adds a kind of effect Smile. 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.

Author:  jamonathin [ Fri Jun 24, 2005 9:39 pm ]
Post subject: 

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.

Author:  [Gandalf] [ Fri Jun 24, 2005 10:38 pm ]
Post subject: 

Hmm, well I ran it on a Althon 64 2.8ghz and it ran pretty fast Wink 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:
code:
Draw.ThickCircle (x,y,radius,thickness,colour)

Just in case Smile.

Author:  wtd [ Fri Jun 24, 2005 11:16 pm ]
Post subject: 

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.

Author:  Cervantes [ Sat Jun 25, 2005 7:34 am ]
Post subject: 

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

Author:  Cervantes [ Sat Jun 25, 2005 9:51 am ]
Post subject:  Ideas

If anyone wants any ideas for procedures/functions to code, a good place to look is the Ruby Class and Library Reference. Sections to pay particular attention to would be strings and arrays.

Author:  Token [ Sat Jun 25, 2005 10:49 am ]
Post subject: 

WOW! awsome idea Cervantes, if anyone is gonna start working on this, let me know so that i can add it to the list.

Author:  Cervantes [ Sat Jun 25, 2005 12:23 pm ]
Post subject: 

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.
Ruby:

myString = "hello WOrld"
myString.capitalize!
puts myString

Output:

Hello world


On the other hand, you could use the function, capitalize.
Ruby:

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 Rolling Eyes). So, instead of using ! at the end, I've made it Make_<method name>. Instead of using ? at the end, I've made it Is_<method name>.

Enough talking about Ruby. Here's the file. Smile

Author:  wtd [ Sat Jun 25, 2005 1:16 pm ]
Post subject: 

Instead of "make", how about "modify"?

Author:  [Gandalf] [ Sat Jun 25, 2005 1:45 pm ]
Post subject: 

Amazing! Some of that stuff is really useful, great idea to take stuff from other languages Smile. 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?

Turing:
    %
    % Calculate the slope between two points.
    % By: [Gandalf]
    %
    function Slope (x1, y1, x2, y2 : real) : real
        var final : real
        final := (y1 - y2) / (x1 - x2)
        result final
    end Slope

    %
    % Calculate the area of a circle.
    % By: [Gandalf]
    %
    function CircleArea (radius : real) : real
        var area : real
        area := PI * (radius ** 2)   %PI is already declared in the Math module
        result area
    end CircleArea

Author:  Token [ Sat Jun 25, 2005 3:12 pm ]
Post subject: 

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

Author:  Bacchus [ Sat Jun 25, 2005 3:20 pm ]
Post subject: 

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:
code:
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

Author:  MysticVegeta [ Sat Jun 25, 2005 3:45 pm ]
Post subject: 

eh?
code:
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)

Author:  [Gandalf] [ Sat Jun 25, 2005 3:45 pm ]
Post subject: 

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 Confused. 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.

Author:  Token [ Sat Jun 25, 2005 3:49 pm ]
Post subject: 

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

Author:  wtd [ Sat Jun 25, 2005 3:59 pm ]
Post subject: 

[Gandalf] wrote:
Amazing! Some of that stuff is really useful, great idea to take stuff from other languages Smile. Ruby seems pretty great.


So, just use Ruby. Razz

Author:  MysticVegeta [ Sat Jun 25, 2005 4:03 pm ]
Post subject: 

[Gandalf] wrote:
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 Confused. 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.

Author:  [Gandalf] [ Sat Jun 25, 2005 4:19 pm ]
Post subject: 

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 Laughing)

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 Smile.

Author:  MysticVegeta [ Sat Jun 25, 2005 4:49 pm ]
Post subject: 

Ah the fraction reducer, i found the CCC problem i coded and turned it into a module

code:
/*
 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

Author:  Token [ Sat Jun 25, 2005 5:06 pm ]
Post subject: 

amazing! its in, umm and as to gandolf, heres the list with ur sudgestions added, and thanks for the help file.


Quote:

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.

Author:  wtd [ Sat Jun 25, 2005 5:10 pm ]
Post subject: 

What about having a Fraction type and then defining operations for it?

code:
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

Author:  [Gandalf] [ Sat Jun 25, 2005 5:16 pm ]
Post subject: 

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:
code:
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?

Author:  Cervantes [ Sat Jun 25, 2005 5:22 pm ]
Post subject: 

[Gandalf] wrote:

Turing:
    %
    % Calculate the slope between two points.
    % By: [Gandalf]
    %
    function Slope (x1, y1, x2, y2 : real) : real
        var final : real
        final := (y1 - y2) / (x1 - x2)
        result final
    end Slope

    %
    % Calculate the area of a circle.
    % By: [Gandalf]
    %
    function CircleArea (radius : real) : real
        var area : real
        area := PI * (radius ** 2)   %PI is already declared in the Math module
        result area
    end CircleArea

Gandalf, those functions could be reduced to one line:
code:

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).

Turing:

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.

Author:  [Gandalf] [ Sat Jun 25, 2005 5:25 pm ]
Post subject: 

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!

Author:  Cervantes [ Sat Jun 25, 2005 5:33 pm ]
Post subject: 

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.

Author:  wtd [ Sat Jun 25, 2005 5:35 pm ]
Post subject: 

[Gandalf] wrote:
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.

Author:  [Gandalf] [ Sat Jun 25, 2005 5:54 pm ]
Post subject: 

Alright, where do I begin...
Cervantes wrote:
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 Smile, 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).
Posted Image, might have been reduced in size. Click Image to view fullscreen.

wtd wrote:
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 Smile.

Alright, I'll add the other spelling of centre/center, and I'll watch out for it in the future, thanks.

Author:  Token [ Sat Jun 25, 2005 5:57 pm ]
Post subject: 

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

Author:  [Gandalf] [ Sat Jun 25, 2005 6:01 pm ]
Post subject: 

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.

Author:  Token [ Sat Jun 25, 2005 6:02 pm ]
Post subject: 

its all in that software, it can be done. Laughing

Author:  [Gandalf] [ Sat Jun 25, 2005 6:07 pm ]
Post subject: 

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 Razz*

Author:  Token [ Sat Jun 25, 2005 6:15 pm ]
Post 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.

Author:  Token [ Sat Jun 25, 2005 6:19 pm ]
Post 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

Author:  jamonathin [ Sat Jun 25, 2005 7:11 pm ]
Post 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.

Author:  MysticVegeta [ Sat Jun 25, 2005 7:21 pm ]
Post 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

Author:  jamonathin [ Sat Jun 25, 2005 7:40 pm ]
Post 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.

Author:  Token [ Sat Jun 25, 2005 7:50 pm ]
Post 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

Author:  jamonathin [ Sat Jun 25, 2005 8:00 pm ]
Post 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

Author:  [Gandalf] [ Sat Jun 25, 2005 8:47 pm ]
Post 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:

Author:  StarGateSG-1 [ Sat Jun 25, 2005 9:01 pm ]
Post 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.

Author:  Cervantes [ Sat Jun 25, 2005 9:08 pm ]
Post 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.

Author:  lyam_kaskade [ Sun Jun 26, 2005 12:24 am ]
Post 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?

Author:  wtd [ Sun Jun 26, 2005 12:26 am ]
Post 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.

Author:  Token [ Sun Jun 26, 2005 9:04 am ]
Post 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

Author:  MysticVegeta [ Sun Jun 26, 2005 9:06 am ]
Post subject: 

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

Author:  MysticVegeta [ Sun Jun 26, 2005 9:10 am ]
Post subject: 

on topic : hey, you know i think alikhan made a base converter, maybe we can make commands for logrithmic functions. Wink

Author:  Token [ Sun Jun 26, 2005 9:11 am ]
Post subject: 

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.

Author:  MysticVegeta [ Sun Jun 26, 2005 9:19 am ]
Post subject: 

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?

Author:  Cervantes [ Sun Jun 26, 2005 9:37 am ]
Post subject: 

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.

Author:  MysticVegeta [ Sun Jun 26, 2005 9:50 am ]
Post subject: 

oh lol i am really into it. lol.
I think the quadratic is useless but the logrithmic functions are quite usefull.

Author:  [Gandalf] [ Sun Jun 26, 2005 4:05 pm ]
Post subject: 

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:
Posted Image, might have been reduced in size. Click Image to view fullscreen.
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 Smile.

Author:  wtd [ Sun Jun 26, 2005 6:17 pm ]
Post subject: 

The only C++ aspect to this is that structs live in the main namespace. In other words, you can write:

code:
Foo* bar;


Rather than:

code:
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.

Author:  StarGateSG-1 [ Mon Jun 27, 2005 10:52 am ]
Post subject: 

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

Author:  [Gandalf] [ Mon Jun 27, 2005 4:06 pm ]
Post subject: 

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?

Author:  StarGateSG-1 [ Mon Jun 27, 2005 4:32 pm ]
Post subject: 

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.

Author:  [Gandalf] [ Mon Jun 27, 2005 4:41 pm ]
Post subject: 

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.

Author:  wtd [ Mon Jun 27, 2005 6:48 pm ]
Post subject: 

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.

Author:  Jorbalax [ Wed Jun 29, 2005 1:07 pm ]
Post subject: 

I'm inclined to agree with wtd...so long Turing, hello C++!

Someone else can take up where I left off if they want.

Author:  Bacchus [ Wed Jun 29, 2005 11:21 pm ]
Post subject: 

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
code:
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 Smile

Author:  Delos [ Thu Jun 30, 2005 3:05 pm ]
Post subject: 

Just dropping by for a bit...

[Gandalf] wrote:
How about something like Pic.Fade or Pic.Opacity. Then you could have the syntax like this:
code:
Pic.Opacity(picID, opacity) %or maybe
Pic.Opacity(picID,opacity,backgroundcolour)


3d box thing is really good.


Opacity can be achieved through my PicMerge[/shameless plug] programme. PM if you're interested in incorporating it into the existing Pic. module, I'll reconstruct the source (optimize etc) and release it.


MysticVegeta wrote:
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.

Author:  jamonathin [ Fri Jul 01, 2005 9:24 pm ]
Post subject: 

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?:

Turing text at the Bottom XD wrote:

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 Confused .

Turing:
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.

Author:  Bacchus [ Fri Jul 01, 2005 11:11 pm ]
Post subject: 

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.

Author:  Cervantes [ Mon Jul 04, 2005 2:43 pm ]
Post subject: 

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. Smile

Author:  jamonathin [ Wed Jul 06, 2005 11:35 pm ]
Post subject: 

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.
code:
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


Author:  MysticVegeta [ Thu Jul 07, 2005 11:29 am ]
Post subject: 

Nice! That looks pretty cool, looks like an oval gradient, good job Smile

Author:  StarGateSG-1 [ Mon Jul 11, 2005 3:58 pm ]
Post subject: 

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??

Author:  [Gandalf] [ Mon Jul 11, 2005 5:44 pm ]
Post subject: 

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.

Author:  jamonathin [ Tue Jul 12, 2005 2:00 am ]
Post subject: 

what black line are you talking about [Gandalf]? I checked it out on different colored backgrounds, with different oval color, and still nothing. Thinking

Author:  Shyfire [ Tue Jul 12, 2005 2:04 pm ]
Post subject:  fullscreen???????????????????????/

k iv got an idea Idea how about editing the window module to have a fullscreen function

Author:  MysticVegeta [ Tue Jul 12, 2005 3:35 pm ]
Post subject: 

Thats not possible because turing cannot interact with Windows API.

Author:  Shyfire [ Tue Jul 12, 2005 3:54 pm ]
Post subject: 

o ic well there goes that idea Sad Crying or Very sad Sad Crying or Very sad Sad Crying or Very sad

Author:  [Gandalf] [ Tue Jul 12, 2005 6:57 pm ]
Post subject: 

Well, see at the attachment, how there is always a black outline (not line Smile) wherever a cirlce overlaps? That's what would happen if there was a, say red background too.

Author:  jamonathin [ Wed Jul 13, 2005 1:53 pm ]
Post subject: 

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?

Author:  [Gandalf] [ Wed Jul 13, 2005 6:18 pm ]
Post subject: 

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.

Author:  jamonathin [ Wed Jul 13, 2005 10:14 pm ]
Post subject: 

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
code:
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.
code:
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. Confused Not sure where to go after this.


: