Author Topic: Anyone Program in Turing Before?  (Read 123 times)

0 Members and 1 Guest are viewing this topic.

Offline Sabb

  • ***
  • 2009 Snowball Competition WinnerWindows UserOld Forum MemberDedicated Summoner
    View More Badges!

  • Posts: 7378
  • Gender: Female
  • Respect: +2400
Anyone Program in Turing Before?
« on: September 15, 2011, 01:46:29 PM »
0
It's a very simple program, Canadian, but not very popular. I basically want to know if anyone's got any good references for me in learning Turing, because I can't seem to find any helpful ones. It's for a basic computer programming class I'm taking, but the class is very slow and boring right now for those who know nothing of coding and such. Or common sense for that matter... but anyways, I just want to learn a bit of it on my own to get a head start and learn how to actually do some practical shit with it. So, if you can link me to some reference page(s) for Turing, I'd really appreciate it.


Lithuanian pride world wide!: sun doesnt revolve around the sun


Offline Peetah

  • ******
  • League PlayerWindows UserDog Lover
    View More Badges!

  • Posts: 3000
  • Gender: Male
  • Respect: +823
Re: Anyone Program in Turing Before?
« Reply #1 on: September 15, 2011, 02:02:41 PM »
0
Ohhh ive used turning in the past.
Theres not much to learn but the language.
I assume your going into python?
(Reg) Nezz45: peetah are you good with the weight tool?

Offline Deathie

  • ***
  • Windows User
    View More Badges!

  • Posts: 5293
  • Gender: Female
  • Respect: +2069
    • Some music shit I made
Re: Anyone Program in Turing Before?
« Reply #2 on: September 15, 2011, 02:10:27 PM »
0
Ohhh ive used turning in the past.
Theres not much to learn but the language.
I assume your going into python?

No clue what Turning is, but I've messed around with a few python scripts. I might be able to help with that.


Check out my Soundcloud for some neat stuff!

Offline Sabb

  • ***
  • 2009 Snowball Competition WinnerWindows UserOld Forum MemberDedicated Summoner
    View More Badges!

  • Posts: 7378
  • Gender: Female
  • Respect: +2400
Re: Anyone Program in Turing Before?
« Reply #3 on: September 15, 2011, 02:11:29 PM »
0
Ohhh ive used turning in the past.
Theres not much to learn but the language.
I assume your going into python?
Not in this course I don't think, but I believe I'll be learning it another.


Lithuanian pride world wide!: sun doesnt revolve around the sun


Offline Sabb

  • ***
  • 2009 Snowball Competition WinnerWindows UserOld Forum MemberDedicated Summoner
    View More Badges!

  • Posts: 7378
  • Gender: Female
  • Respect: +2400
Re: Anyone Program in Turing Before?
« Reply #4 on: November 13, 2011, 09:48:26 AM »
0
bumpingas
With all the Canadians on RND there's got to be someone who knows a bit about Turing ._..
If anyone has recently used Turing and is fluent in it, please pm me or post on this thread. I just need help with a very simple little thing, just not sure if it's physically possible in Turing though.


Lithuanian pride world wide!: sun doesnt revolve around the sun


Offline Tomcat

  • Your Argument is Inert
  • ******
  • Donator
    View More Badges!

  • Posts: 2539
  • Gender: Male
  • Wat Do?
  • Respect: +503
    • Tomcat's blog
Re: Anyone Program in Turing Before?
« Reply #5 on: November 13, 2011, 01:32:44 PM »
0
bumpingas
With all the Canadians on RND there's got to be someone who knows a bit about Turing ._..
If anyone has recently used Turing and is fluent in it, please pm me or post on this thread. I just need help with a very simple little thing, just not sure if it's physically possible in Turing though.

it reminds me of some code i did in the past(cant remember the lang)

Show me the script and lets see I can help yah

Offline Sabb

  • ***
  • 2009 Snowball Competition WinnerWindows UserOld Forum MemberDedicated Summoner
    View More Badges!

  • Posts: 7378
  • Gender: Female
  • Respect: +2400
Re: Anyone Program in Turing Before?
« Reply #6 on: November 13, 2011, 01:54:14 PM »
0
it reminds me of some code i did in the past(cant remember the lang)

Show me the script and lets see I can help yah

Code: [Select]
View.Set ("graphics:1020;475")
View.Set ("offscreenonly")

var topR, btmR, topRPrev, btmRPrev, btmBOS : int
topRPrev := 11
btmRPrev := 11
var mx, my, button : int

Draw.FillBox (0, 0, 30, 30, black)
var block, lastBtmBCleared : int
block := Pic.New (0, 0, 30, 30)
var bR, tR, bRPrevX, bRPrevY, tRPrevX, tRPrevY : array 1 .. 35 of int
for fillBR : 1 .. 35
    bR (fillBR) := Sprite.New (block)
end for
for fillTR : 1 .. 35
    tR (fillTR) := Sprite.New (block)
end for
proc btmBlocks
    if btmBOS = 34 then     %-when declaring lastBtmBCleared in main program, declare btmBOS := 3
        Sprite.SetPosition (bR (lastBtmBCleared), maxx, btmR div 30, false)         %-draw new box here, at maxx (not centered if sprite)
    end if
    for btmBlockNum : 1 .. 35 %-34 = maxx div 30 -box width, 34 = max boxes on screen at once (on one row)
        Sprite.SetPosition (bR (btmBlockNum), bRPrevX (btmBlockNum) - 1, bRPrevY (btmBlockNum), false)
        bRPrevX (btmBlockNum) -= 1     %-hold previous bR x value
        bRPrevY (btmBlockNum) := btmR     %-hold previous bR y value
    end for
    View.Update
end btmBlocks

cls
var y : int := maxy div 2
var countDFont1, countDFont2, pauseFont : int
countDFont1 := Font.New ("impact:100:bold")
countDFont2 := Font.New ("impact:110:bold")
pauseFont := Font.New ("impact:20:bold")
var owl1, owl2 : int
owl1 := Pic.FileNew ("owl1.2.jpg")
owl2 := Pic.FileNew ("owl2.2.jpg")
owl1 := Sprite.New (owl1)
owl2 := Sprite.New (owl2)
var time0 : int := 0
var time0_1 : int := 0

var pauseBox : int
Draw.FillBox (100 + 150, maxy div 2 - 20, (maxx div 2 + 740) div 2 + 150, maxy div 2 + 40, black)
Draw.Text ("AUTOMATICALLY PAUSED, CLICK TO UNPAUSE", 110 + 150, maxy div 2, pauseFont, gray)
pauseBox := Pic.New (100 + 150, maxy div 2 - 20, (maxx div 2 + 740) div 2 + 150, maxy div 2 + 40)
pauseBox := Sprite.New (pauseBox)
Sprite.SetPosition (pauseBox, 100 + 150, maxy div 2 - 20, false)

proc moveOwl (upDown : int)
    if upDown = 1 then     %Moving down.
        Sprite.Show (owl2)
        Sprite.SetPosition (owl2, 150, y, true)
        View.Update
        %delay (3) -original delay time
    end if
    if upDown = 2 then     %Moving up, flapping wings.
        if time0 < 100 then     %If the wings have been up for less than .1 seconds, then keep them up.
            Sprite.Show (owl2)
            Sprite.SetPosition (owl2, 150, y, true)
            View.Update
            %delay (3)
            time0 += 6
        end if
        if time0 > 100 then     %If the wings have been up for .1 seconds, then flap.
            Sprite.Hide (owl1)
            Sprite.Show (owl2)
            Sprite.SetPosition (owl2, 150, y, true)
            View.Update
            %delay (3)
            if time0 > 100 * 2 then     %Once the wings have been down for .1 seconds, flap, and repeat.
                time0 := 0
            end if
        end if
    end if
end moveOwl



%MAIN PROGRAM
var bgColour : int
bgColour := RGB.AddColour (75 / 255, 75 / 255, 75 / 255)
Draw.FillBox (0, 0, maxx, maxy, bgColour)
moveOwl (1)
View.Update
delay (3000)
loop     %Countdown, using sprites. -LATER MOVE/FADE(?) COUNTDOWN -loop to create t1, t1, and t3 temporarily for sprites
    var t1, t2, t3 : int
    Draw.Text ("3", maxx div 2, maxy div 2, countDFont1, red)
    Draw.Text ("3", maxx div 2, maxy div 2, countDFont2, black)
    t1 := Pic.New (maxx div 2, maxy div 2, maxx div 2 + 100, maxy div 2 + 150)
    t1 := Sprite.New (t1)
    cls
    Draw.FillBox (0, 0, maxx, maxy, bgColour)
    Draw.Text ("2", maxx div 2, maxy div 2, countDFont1, red)
    Draw.Text ("2", maxx div 2, maxy div 2, countDFont2, black)
    t2 := Pic.New (maxx div 2, maxy div 2, maxx div 2 + 100, maxy div 2 + 150)
    t2 := Sprite.New (t2)
    cls
    Draw.FillBox (0, 0, maxx, maxy, bgColour)
    Draw.Text ("1", maxx div 2, maxy div 2, countDFont1, red)
    Draw.Text ("1", maxx div 2, maxy div 2, countDFont2, black)
    t3 := Pic.New (maxx div 2, maxy div 2, maxx div 2 + 100, maxy div 2 + 150)
    t3 := Sprite.New (t3)
    cls
    Draw.FillBox (0, 0, maxx, maxy, bgColour)
    moveOwl (1)
    View.Update
    %Outputting/displaying the sprites.
    Sprite.SetPosition (t1, maxx div 2, maxy div 2, true)
    Sprite.Show (t1)
    View.Update
    delay (1000)
    Sprite.Hide (t1)
    Sprite.SetPosition (t2, maxx div 2, maxy div 2, true)
    Sprite.Show (t2)
    View.Update
    delay (1000)
    Sprite.Hide (t2)
    Sprite.SetPosition (t3, maxx div 2, maxy div 2, true)
    Sprite.Show (t3)
    View.Update
    delay (1000)
    Sprite.Hide (t3)
    exit
end loop

loop
    mousewhere (mx, my, button)
    if button = 1 then
        y += 2
        moveOwl (2)
    else
        y -= 2
        moveOwl (1)
    end if
    if mx < 0 or mx > maxx or my < 0 or my > maxy then
        if button = 1 then
            Sprite.Show (pauseBox)
            View.Update
            loop
                mousewhere (mx, my, button)
                if mx > 0 and mx < maxx and my > 0 and my < maxy and button = 1 then
                    Sprite.Hide (pauseBox)
                    View.Update
                    exit
                end if
            end loop
        end if
    end if
    topR := Rand.Int (1, 10)
    btmR := Rand.Int (1, 10)
    topR := maxx - (topR * 30)
    btmR := btmR * 30
    if topRPrev = 11 or topR > topRPrev + 2 then
        topR := topRPrev + 2
    elsif topR < topRPrev - 2 then
        topR := topRPrev - 2
    end if
    if btmRPrev = 11 or btmR > btmRPrev + 2 then
        btmR := btmRPrev + 2
    elsif btmR < btmRPrev - 2 then
        btmR := btmRPrev - 2
    end if
    Pic.Draw (block, maxx + 30, btmR div 30, picMerge)
    topRPrev := topR
    btmRPrev := btmR
    View.Update
end loop

So far that's all the code I've got for it. Adding a hell of a lot more.
Anyways, I figured out my original question, but while I'm at it, the program basically is just to make a simple game similar to that good old helicopter one, where you flying around and dodge shit. I'm making that with a lot of other stuff added to it. I know how I could make a level editor to, obviously, make your own level, but I don't quite know of a simple way of playing through that level. The level would run from left to right, and would need to be quite long, possibly looping, but I can't quite think of how I could make the level actually move, and generate properly, at least not without a hell of a sprites and arrays.
I also want to figure out how I could save a map file , and be able to use it after closing the program and reopening it if possible :L.
« Last Edit: November 13, 2011, 02:21:22 PM by Sabb »


Lithuanian pride world wide!: sun doesnt revolve around the sun