# getting-started

Ray Rahke

03/03/2024, 9:09 PM
Is there no way to wipe all the previous println's in the terminal output? I am making a simple terminal game and am trying to create an animation of characters moving across the screen, so I need to be erasing the terminal each time.

Casey Brooks

03/03/2024, 9:24 PM
There's nothing out of the box, since it things like colors and clearing terminal text depends on how the terminal interprets the output, and can get quite difficult. You can do it by manually outputting ANSI control codes, but I wouldn't recommend trying that. Instead, you might check out Mosaic, which is Compose for terminal UIs

Ray Rahke

03/03/2024, 9:26 PM
I can't expect my children students to know how to set that up 😕,
and don't want them to have to copy paste a template
just trying to find a way to make this language work for teaching.
it is obviously the best in terms of syntax. but the whole ecosystem is so framework oriented and complicated..
like, just making a simple cellular automata program on the command line, is somehow not trivial to do
i am comparing this to previous teaching experience using python where students are able to create a single file, write a few lines of code to receive input and print text, and clear the terminal each time to simulate animation

Casey Brooks

03/03/2024, 9:35 PM
Personally, I don't see any issue with having students start their projects from a template repo. Any language is going to make you do that, so it prepares them for real world programming. Most of the projects I did in college started by copying a repo. I agree that Mosaic probably isn't appropriate for teaching, though. In that case, it might be worth it teaching them to use ANSI control codes. Or alternatively, many of my college projects just printed a few newlines between each "update". Sure you'll see multiple steps in the terminal at once, but that might be a better option to help focus the lesson on one specific thing, and not get in the weeds of terminal codes and stuff like that.
Also, the comparison to Python isn't really a great one, because Python was designed to be a scripting language. Kotlin was not. However, it does support some level of scripting, so you might consider installing the
compiler, and using that directly from the terminal to run
files instead of a full project
The scripting functionality won't be as nice as Python, because Kotlin is not primarily a scripting language, but it can help reduce some of the pain of setting up new projects for assignments. Also, you might consider Intellij Idea for Education

Adam S

03/03/2024, 11:04 PM
Mordant is another nice library for pretty terminal output Controlling the terminal is done using ANSI escape codes, which aren't supported by all environments, which is why the answers here are inconsistent.


03/04/2024, 2:30 AM


03/04/2024, 9:16 AM
Kotter is another pretty good terminal output library

Marcin Wisniowski

03/14/2024, 2:13 PM
Sure you’ll see multiple steps in the terminal at once
That just means you are not printing enough newlines. 😄 Given enough newlines, the new output will be always be at the same place at the bottom of the screen with nothing else visible, end so effectively “update in place”. Of course it’s a very hacky way of achieving it, but it is very simple to do.