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

Username:   Password: 
 RegisterRegister   
 Turing Alphabet Colour Program
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
codergirl




PostPosted: 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!
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




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




PostPosted: 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
Insectoid




PostPosted: 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
codergirl




PostPosted: 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.
Srlancelot39




PostPosted: 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().
Srlancelot39




PostPosted: 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!"
codergirl




PostPosted: 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
Srlancelot39




PostPosted: 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
codergirl




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




PostPosted: 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.
codergirl




PostPosted: 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
Srlancelot39




PostPosted: 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
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 13 Posts ]
Jump to:   


Style:  
Search: