java - Print many multilines strings at the same place -
i'd create little animation in console app , this, i've created ascii art:
______ ,.:b-'::' ,`::-/,._ _.\\,,-/` /| | ,' .`| ,_: ,. ` -_,'[ ._-|/,'y ` ` / -/,-.:`. ,'/[(o _.. _,".`':| ___ ::/|.`][,'/,,/,'`. `:-\-. `','\`,-' [:_,.....'__ ^..,|-.'- ,,\ :. ,'-\-.` _ `[.- --' '-..`'-[''\ .l-",`. ,l< ':],, ,` ,- '- , .''y"-'.-'` _'_,::''/-]._,' _ .. .._ `.`]'. -,-:,^. _'/,[``.-'/'- _ :].-''`'''''--.[ -. .|/:l:| \ '[' ]>] ' /' _,' `- . ``\'` ,u[<l' /,`. [-' / ,` ,. `. `.`,,``..| | p.p.`[o'), ,''`__-. ,' /'\, .\'( ; .:] /`/ ` .'/xxx `,' . -. ,' ,' `. \.> :,` | \.u[/\'|x x/\' 'v ^, ,' ,' \ \ `^/:.-, | .:-<.. [||/ xxx '/ `\ `\ ,' /' .\ || \]::`.' | |::>,-b| || ^. '---' ,' y| || [./.'/\ | /_,[| || || | ,. / || || |> --|| y=]l__`=[| || | ,- ' || | ::_,==: | |i .| |'. \ /' ,..._ `' || || /l. , |_]l,.'-] | [\ ,- ,' ,' '. || 'p..l, / | v...-l\ \\ `/. ,' ,' `. -_ / /|'y\-.`::' \ -:,'\.., \`\ _,' /' ^, /, .[-` ,' )_ ' '.\ `[`, /' `.'\,'' /`..:- | <`...,`./ ` `[.= `= / ,_/-/.` '' \`[,-'.v'\`. ".`._ _.:' '-' '.>/ ' [,_,l!`, [` ' `-...______.,-' v /'''|]:.' ``\ //'. .`.`. ' --- -- '' ',-|' ' b'' `.yv-]-, ',-.'- ,-'''\ [,.-,' `['./,l|'`.],.. .__ _ ,.',. .[ ]'v'] `v-/| <." ..`\-.. ::_ |: ,.-\\',.\'- ' '',' `.:`[/ / ' > .:',.||::_|/--'. ``,\ '/: ' -',:.\`[| .'/,[/ l',] ^ /``,] ``-` -\|, -,: |`-|||/ |``.,..\`_,-' ''--.' ==='|::::\'-'' (yeah, it's roulette)
i created same ascii arts ball in different positions (like cross on roulette).
my problem is, think, quite tricky: i'd print roulette console 4 times per sec (maybe more, not know) @ same place in order it's looks gif :). i've no problem load files (and transform them string) didn't find way rewrite @ same place (the "\r" won't work multiline text).
it great, if without using library curses (although i'm big fan of ncurses in python!).
i think curses or going necessary.
as remember (curses long time ago), there 2 points curses -- different terminals, , efficiency on slow terminal connections. you're going face both problems, depending on how terminals connected , how end wanting repaint screen.
curses analyzed desired output determine efficient way draw stuff -- should position cursor 3 times , draw things separately, or output multiple lines , draw them once? , character sequences necessary position cursor?
good luck it, regardless.
java console ascii-art
No comments:
Post a Comment