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

Username:   Password: 
 RegisterRegister   
 Colour Indexter! Hope You Like
Index -> Programming, Turing -> Turing Submissions
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Triple Five




PostPosted: Wed Dec 10, 2003 1:44 pm   Post subject: Colour Indexter! Hope You Like

code:
%COLOR INDEXING PROGRAM BY Triple Five, 2003
setscreen("graphics:600;240,nocursor")
var count,colcount : int := 1
var colo : int := 0
var x2,x1,y1,y2 : int
var number : string
var opening : string := "Triple Fives Color Indexer"
var run : string := "RUNNING..."


locate(maxrow div 2,(maxcol div 2) - 12)
for i:1..21
put opening(i)..
delay(80)
end for
delay(250)
locate(maxrow div 2 + 1,(maxcol div 2) - 8)
for z:1..10
put run(z)..
delay(110)
end for

delay(750)
cls
for a:000..255
    delay(20)
    if a < 10 then
        number := "00"
        elsif a < 100 then
        number := "0"
        elsif a > 99 then
        number := ""
    end if
    colorback(0)
    put number, a, " = "..
    colorback(a)
    put "  "
    count:= count + 1
    if count = 27 then
    colcount := colcount + 10 count := 1
    end if
    locate(count,colcount)
end for
colorback(0)
    x1 := 0
    y1 := 20
    x2 := 600
    y2 := 1
for b:0..255
    delay(10)
    drawfillbox(x1,y1,x2,y2,colo)
    colo := colo + 1
    x1 := x1 + 2
end for


By the way im in grade 10 programming and i have to build a house for my final project... if anybody has any good hints or tips or something like that plz post...would be thankful
Sponsor
Sponsor
Sponsor
sponsor
Maverick




PostPosted: Wed Dec 10, 2003 1:45 pm   Post subject: (No subject)

Hmm I've seen that code before. I don't think you wrote that.
Triple Five




PostPosted: Wed Dec 10, 2003 1:46 pm   Post subject: (No subject)

yah you n00b i'm the one who wrote that program....theres another program on this site that has a colour indexter but its different...mines ahole lot better.....
Mazer




PostPosted: Wed Dec 10, 2003 5:20 pm   Post subject: (No subject)

Eh well, lots of people have made their own colour programs before, and there isn't a whole lot you can do to make them any different from one another so it's hard to say whether or not Triple Five wrote this program. as for this program being better than a colour indexer on this site, which program would you be referring to Triple Five?
i don't want to come across as a jerk here, but your program doesn't even fully work.

i can get it to run to completion if i comment out the locate(count,colcount) line, but then it scrolls by quickly and you can't go back to see the colours in the beginning (running on 4.0.4c by the way). you might want to consider making the run window larger and having more than one colour on the same line so they'll all fit. and if you're up for a challenge (depending on how experienced you are with turing's features), you might want to try implementing mouse control or trying to use the GUI.

oh, and don't call people n00b's, that just isn't nice.
Triple Five




PostPosted: Wed Dec 10, 2003 7:03 pm   Post subject: (No subject)

by the way i use 3.11 and it works fine.. 4.0 just has different codeing techniques and i don't knwo them cause i'm new. by the way ill try the mouse and GUI think....and Maverick is my friend we go to the same school and he seems to think he's smarter than me so i call him n00b...we just joke around half the time Laughing
Triple Five




PostPosted: Wed Dec 10, 2003 7:38 pm   Post subject: (No subject)

hey mazer, i looked around a bit and i found a couple and they were better than mine, but i am new at this(2 months) and i thought that this program was a good colour indexter... if you set the res by 800;600 it will work. By the way can you help me out on making a paint program so that i can use the colours in the my indexter to create images... thanks Very Happy
poly




PostPosted: Wed Dec 10, 2003 8:15 pm   Post subject: (No subject)

Quote:
By the way im in grade 10 programming and i have to build a house for my final project... if anybody has any good hints or tips or something like that plz post...would be thankful

you could make the house in Paint and than just display the image in turing.... or you could use the DRAW commands to make the house
Mazer




PostPosted: Wed Dec 10, 2003 8:35 pm   Post subject: (No subject)

Triple Five, yeah i can probably help, what do you need help with? (pm me with any problems or post them in the turing help section so the mods don't get mad for spamming in the source code section)
Triple Five




PostPosted: Wed Dec 10, 2003 9:27 pm   Post subject: (No subject)

thanks guys Very Happy

there this program (snow program)

code:
View.Set ("offscreenonly")
colorback (blue)
cls

type SnowType :
    record
        X, Y, Spd, Size : int
    end record

var Snow : array 1 .. 100 of SnowType

for rep : 1 .. 100
    Snow (rep).X := Rand.Int (5, 645)
    Snow (rep).Y := Rand.Int (5, 475)
    Snow (rep).Spd := Rand.Int (1, 3)
    Snow (rep).Size := Snow (rep).Spd
end for

loop
    for rep : 1 .. 100
        Snow (rep).Y -= Snow (rep).Spd
        if Snow (rep).Y < Snow (rep).Size then
            Snow (rep).Y := Rand.Int (475, 575)
        end if
        drawfilloval (Snow (rep).X, Snow (rep).Y, Snow (rep).Size, Snow (rep).Size, white)
    end for
    delay(100)
    cls
end loop


and i want to have it running with my house assignment but there is a continous loop around the snow program and i dont want to have my entire house in a loop and when i exit the loop oviously the snow stops fallin...can you help me with the snow i need it to run by itself so that it is always running and i dont have to loop it so that i can get somemore animation going into my house....thanks

next time ill post in help
Homer_simpson




PostPosted: Wed Dec 10, 2003 9:49 pm   Post subject: (No subject)

yer program has got all the basics of a particle system... cool
AsianSensation




PostPosted: Wed Dec 10, 2003 11:36 pm   Post subject: (No subject)

to make the your house appear, have a procedure that draws the entire house. Now before the View.Update part, call that procedure, so that the house shows.

btw, where did you get that code, looks pretty good Razz
Maverick




PostPosted: Thu Dec 11, 2003 2:57 pm   Post subject: (No subject)

I think i saw it somewhere on this site or somewhere else on the internet. Pretty good program though.
AsianSensation




PostPosted: Thu Dec 11, 2003 4:41 pm   Post subject: (No subject)

Maverick wrote:
I think i saw it somewhere on this site or somewhere else on the internet. Pretty good program though.


hehe, of course you would see it on this site, I made that thing Razz
AsianSensation




PostPosted: Fri Dec 12, 2003 12:00 am   Post subject: (No subject)

btw, I made a better snow program, here it is.

code:
View.Set ("offscreenonly")
colorback (black)
cls

var size : int := 200
var counter : real := 0
var t1 := Time.Elapsed
var d := 1

type SnowType :
    record
        X, Y, Spd, Size : real
    end record

var Snow : array 1 .. size of SnowType

for rep : 1 .. size
    Snow (rep).X := Rand.Int (0, maxx)
    Snow (rep).Y := Rand.Int (0, maxy)
    Snow (rep).Spd := Rand.Real * Rand.Int (1, 3)
    Snow (rep).Size := Snow (rep).Spd
end for

loop
    for rep : 1 .. size
        Snow (rep).Y -= Snow (rep).Spd
        Snow (rep).X += counter
        if Snow (rep).Y < 0 then
            Snow (rep).Y := Rand.Int (maxy, maxy + 100)
        end if
        if Snow (rep).X > maxx then
            Snow (rep).X := Rand.Int (-10, 0)
        end if
        if Snow (rep).X < 0 then
            Snow (rep).X := Rand.Int (maxx, maxx + 100)
        end if
        drawfilloval (round (Snow (rep).X), round (Snow (rep).Y), round (Snow (rep).Size), round (Snow (rep).Size), white)
    end for
    counter += d * 0.05

    if counter < 2 and counter > -2 then
        t1 := Time.Elapsed
    end if

    if (Time.Elapsed - t1) > 2000 and (counter >= 10 or counter <= -10) then
        d *= -1
        t1 := Time.Elapsed
    end if
    View.Update
    delay (5)
    cls
end loop


you can use it if you want, just do give credits where it's due.
santabruzer




PostPosted: Fri Dec 12, 2003 12:08 am   Post subject: (No subject)

now that's a snow program.. amazing snow program....
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 19 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: