Computer Science Canada

Turing Alphabet Colour Program

Author:  codergirl [ Tue Mar 27, 2018 9:16 pm ]
Post subject:  Turing Alphabet Colour Program

Hi guys! Very Happy

I'm a super Turing newbie and I'm trying to create a program that displays the capital letters of the alphabet one at a time in the entire colour spectrum (like on an elevator)

This is my code and I can't get the letters to appear one by one side by side like A B C D... (they somehow only appear in the same place? BooHoo )
Can someone help me figure out what's wrong? I've tried everything!

CODE:

for counter : chr (65) .. chr (90)
for counter2 : 1 .. 255
color (counter2)
put counter ..
delay (4)
cls
end for
end for



THANK YOU!

Author:  Insectoid [ Wed Mar 28, 2018 8:05 pm ]
Post subject:  RE:Turing Alphabet Colour Program

cls will clear the screen and reset the cursor. If you remove it, the screen will no longer clear, the cursor will no longer reset, and the characters will appear one after another. Unfortunately, this will cause every character to 255 times. Can you think of a way to fix that?

Author:  codergirl [ Thu Mar 29, 2018 9:07 am ]
Post subject:  Re: Turing Alphabet Colour Program

Thanks for the advice! I've tried to omit the cls and have run into that problem where the letters are displayed 255 times, and have noooo idea how to fix it...
can you just give me a push in the right direction? Razz

Author:  Insectoid [ Sat Mar 31, 2018 1:33 am ]
Post subject:  RE:Turing Alphabet Colour Program

At this point the question is, what exactly do you want do display? You haven't adequately defined your objective, so it's impossible to code

Author:  codergirl [ Sat Mar 31, 2018 8:44 am ]
Post subject:  Re: Turing Alphabet Colour Program

Sorry if I wasn't being clear enough, I'll try to clarify.

So I want the whole alphabet to be displayed, with each letter going through the whole color spectrum before changing into the next letter. Then the first letter would disappear, and be replaced with the next letter of the alphabet (think of the floors on an elevator).


So for example, A would appear, go through the 255 colors of the spectrum, disappear, and then be replaced with B which appears beside it.

I got the letters to appear one after the other, and each of them to go through the color spectrum, but I can't get the first letter to disappear and then the next letter to appear right beside it.
What happens is that A would disappear, and then B appears in the same spot as A, but I don't want that.

Author:  Srlancelot39 [ Sat Mar 31, 2018 1:03 pm ]
Post subject:  Re: Turing Alphabet Colour Program

Font.Draw() would be very helpful here. Take a look at its syntax... Razz

Edit:locate() could be used as well if you'd prefer to stick to put, but personally I would use Font.Draw().

Author:  Srlancelot39 [ Sat Mar 31, 2018 1:20 pm ]
Post subject:  Re: Turing Alphabet Colour Program

General forum tip:
Surround code segments with the "Code" or "Syntax" tag to make it more readable.

code:
put "Hello World!"


Turing:
put "Hello World!"

Author:  codergirl [ Sat Mar 31, 2018 9:15 pm ]
Post subject:  Re: Turing Alphabet Colour Program

Ok thanks! I've never used Font.Draw before, so I'll take a look!

Hopefully, it solves the problem I'm having about the letters not appearing side by side... Embarassed Embarassed Embarassed

Author:  Srlancelot39 [ Mon Apr 02, 2018 7:58 am ]
Post subject:  Re: Turing Alphabet Colour Program

It's a bit more complex than put, but that complexity provides more possibilities. Remember that the parameters can be variables! Wink

Author:  codergirl [ Mon Apr 02, 2018 1:25 pm ]
Post subject:  Re: Turing Alphabet Colour Program

Ok thanks for the clarification! So you think that Font.Draw will solve my issue of the letters not being able to appear beside each other?

Author:  Srlancelot39 [ Tue Apr 03, 2018 8:32 am ]
Post subject:  Re: Turing Alphabet Colour Program

Definitely. As the name suggests, it draws the text as opposed to typing it with a cursor and line feeds and tabs etc., so whatever text it prints is independent of anything else that is drawn or typed. You will need to control the location the letters are printed at, as well as how/when to clear the previous letter, but that shouldn't be too difficult.

Author:  codergirl [ Mon Apr 16, 2018 7:58 pm ]
Post subject:  RE:Turing Alphabet Colour Program

Thank you! Font.Draw worked perfectly! Though when it gets to "Z" it crashes (at the right moment haha) and says something about eos... what does that mean?
PS- I gave you some bits! Bday Bday Bday

Author:  Srlancelot39 [ Tue Apr 17, 2018 8:43 am ]
Post subject:  RE:Turing Alphabet Colour Program

Awesome! Good to hear! EOS stands for End Of String. Sounds as if you have a piece of code that is trying to read past the end of a string?

Thanks for the bits!

Have some karma! Smile


: