Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

I'm trying to transfer this to Codea

edited January 2014 in Code Sharing Posts: 15
print("what is your name")
name= io.read()
print('Hello, you look beautiful today '.. name)

repeat
   print("How many stars would you like")
   n = io.read('*n')
   s = ''
   for i = 1, n do
      s = s .. '*'
   end
   print(s)
   print("Would you like anymore (yes/no)?")
   m = io.read()
until m ~= 'yes'
print("goodbye, " .. name)

Comments

  • Posts: 2,820

    Codea does not support reading from the console. You will have to use parameter.text() (look at docs). Also, to format your code properly, use ~~~ before and after code. Welcome to the forums, BTW!

  • IgnatzIgnatz Mod
    Posts: 5,396

    Codea is a graphic program, not a text program. It is designed to animate games, puzzles etc, and only has limited text support.

  • @Zoyt thank you!

  • Posts: 2,820

    Glad I could help.

  • dave1707dave1707 Mod
    Posts: 7,673

    @Willkassens You asked a similar question in a previous post "Game text code help to fix" about io.read. You were given an example of what's involved. It's not going to change just because you ask a different question.

  • Thanks. It weird trying to transition from what I previously used. @dave1707

  • dave1707dave1707 Mod
    edited January 2014 Posts: 7,673

    @Willkassens There's a lot of new things to learn and ways of doing it when switching to Codea. I found it quite awkward at first using Codea, but now it seems natural. It's even easy doing a lot of things that were impossible in the other languages I was using.

  • IgnatzIgnatz Mod
    Posts: 5,396

    @Willkassens - I strongly recommend looking at some of the tutorials and ebooks on the wiki link above, to get an understanding of how Codea "thinks". It is quite different from normal programming, but very addictive when you get used to it.

  • @Ignatz I'll make sure to do that!

Sign In or Register to comment.