<commit_before>package com.roadwaffle.asciisnow

import com.googlecode.lanterna._
import com.googlecode.lanterna.terminal._
import com.googlecode.lanterna.terminal.text._
import java.nio.charset.Charset
import scala.util.Random
import java.lang.Math
import scala.util.control.Breaks._

object AsciiSnow {

	val terminal = new UnixTerminal(System.in, System.out, Charset.forName("UTF8"))
	//val terminal = TerminalFacade.createTerminal(System.in, System.out, Charset.forName("UTF8"))

	val REFRESH = 30;

	val cols = terminal.getTerminalSize.getColumns
	val rows = terminal.getTerminalSize.getRows
	val rand = new Random
	val numflakes: Int = cols
	val flakes = for (i <- (0 to numflakes).toList) yield new Flake().init

	def main(args: Array[String]) {
		try {
			terminal.enterPrivateMode
			terminal.applyForegroundColor(Terminal.Color.WHITE)
			terminal.applyBackgroundColor(Terminal.Color.BLACK)
			terminal.clearScreen
			for(y <- 0 to rows) for(x <- 0 to cols) { terminal.moveCursor(x, y); terminal.putCharacter(' ') }

			breakable {
				while(true) {
					flakes.foreach(_.update)
					terminal.flush
					terminal.readInput match {
						case null => 
						case _ => break
					}
			  		Thread.sleep(REFRESH)
				}
			}
		} finally {
			terminal.exitPrivateMode
		}
	}<commit_msg>adding hide cursor<commit_after>package com.roadwaffle.asciisnow

import com.googlecode.lanterna._
import com.googlecode.lanterna.terminal._
import com.googlecode.lanterna.terminal.text._
import java.nio.charset.Charset
import scala.util.Random
import java.lang.Math
import scala.util.control.Breaks._

object AsciiSnow {

	val terminal = new UnixTerminal(System.in, System.out, Charset.forName("UTF8"))
	//val terminal = TerminalFacade.createTerminal(System.in, System.out, Charset.forName("UTF8"))

	// Extra VT100 escape codes...
	val ESCAPE: Char = 0x1b;
	val HIDE_CURSOR = ESCAPE+"[?25l"
	def hideCursor = { print(HIDE_CURSOR) }
	val SHOW_CURSOR = ESCAPE+"[?25h"
	def showCursor = { print(SHOW_CURSOR) }

	val REFRESH = 30;

	val cols = terminal.getTerminalSize.getColumns
	val rows = terminal.getTerminalSize.getRows
	val rand = new Random
	val numflakes: Int = cols
	val flakes = for (i <- (0 to numflakes).toList) yield new Flake().init

	def main(args: Array[String]) {
		try {
			println(HIDE_CURSOR);
			terminal.enterPrivateMode
			terminal.applyForegroundColor(Terminal.Color.WHITE)
			terminal.applyBackgroundColor(Terminal.Color.BLACK)
			terminal.clearScreen
			for(y <- 0 to rows) for(x <- 0 to cols) { terminal.moveCursor(x, y); terminal.putCharacter(' ') }

			breakable {
				while(true) {
					flakes.foreach(_.update)
					terminal.flush
					terminal.readInput match {
						case null => 
						case _ => break
					}
			  		Thread.sleep(REFRESH)
				}
			}
		} finally {
			terminal.exitPrivateMode
			println(SHOW_CURSOR);
		}
	}
{'fraction_non_alphanumeric': 0.11322081575246132, 'fraction_numerical': 0.00808720112517581, 'mean_word_length': 3.7815126050420167, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5932838', 'n_tokens_mistral': 1147, 'n_tokens_neox': 973, 'n_words': 200}