49
Bob-
7y

Learning text animations in c++ be like:

Comments
  • 8
    Take that logic out to a function and call it
  • 3
    @bioDan look closely on the top left 😉
  • 8
    I mean the sleep and the string to a function and deal with it there.. Separate the string and treat it as an array of chars. Save the index of the uppercase char in the string. Downcase the string, and increment the next char in the string array to an uppercase using the index.
  • 3
    @bioDan totally understand..
    Totally not a newbie
    Totally not in need of a dummed down explanation

    (I am)
    (Also thank you)
  • 2
    Make a variable for the string of /bs at least.
  • 1
    What @killermenpl said.
  • 1
    @slowinversesqrt I haven't thought of that! Thank you, you just made my code not so ugly :)
  • 1
    Why all the \b and not \r?
  • 0
    \b makes it stay there even if the cursor was somewhere in between the screen. \r would make it go to the beginning
  • 1
    @Duckman use an array of chars, loop over each char and change it to uppercase according to the loop index
  • 1
    @bioDan

    I remember doing something like this but with a function that took arguments.

    looked something like

    void draw(to, from, paint, message) { . . .}

    where to and from is arr of x and y coor

    paint is an array of characters to alternate through while printing

    and message is the text to print when it reaches the destination.
Add Comment