Skip to content

Instantly share code, notes, and snippets.

View Mastytch's full-sized avatar

Andriy M. Mastytch

  • Ukraine
View GitHub Profile
@Mastytch
Mastytch / Codingame Java Mars Lander Episode 1
Last active December 25, 2016 10:31
Codingame Java Mars Lander Episode 1 v2
import java.util.*;
import java.io.*;
import java.math.*;
/**
* Auto-generated code below aims at helping you parse
* the standard input according to the problem statement.
**/
class Player {
@Mastytch
Mastytch / gist:e8e89ac25115970aff0be94cf4a379ba
Last active July 24, 2020 19:30
codingame Java A power of Thor
import java.util.*;
import java.io.*;
import java.math.*;
/**
* Auto-generated code below aims at helping you parse
* the standard input according to the problem statement.
* ---
* Hint: You can use the debug stream to print initialTX and initialTY, if Thor seems not follow your orders.
**/
import java.util.*;
import java.io.*;
import java.math.*;
/**
* The while loop represents the game.
* Each iteration represents a turn of the game
* where you are given inputs (the heights of the mountains)
* and where you have to print an output (the index of the mountain to fire on)
* The inputs you are given are automatically updated according to your last actions.
import java.io.IOException;
public class Main {
public static void main(String[] args) throws IOException {
Game game = new Game();
game.start();
}
}
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Game {
void start() throws IOException {
double midTime = 0;
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
for (int i = 0; i < 5; i++) {
import java.io.IOException;
import java.util.List;
public class MyRunnable implements Runnable {
public void run () {
System.out.println ("\nПоток создан");
/* Operations operations = new Operations ();
String outputFile = "outputFile.ddt";
List<String> compiledList;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
public class Operations {
private BufferedReader reader;
private PrintWriter writer;
private List<String> fileContent = new ArrayList<> ();
private List<String> output = new ArrayList<> ();
import java.io.*;
import java.util.ArrayList;
import java.util.List;
public class MultiThreadTestDrive{
public static void main (String[] args) throws IOException {;
File file = new File ("/Users/mastytchmac/IdeaProjects/HomeWorkLesson2_1/myInputDirectory/");
String outputFile = "outputFile.ddt";
List<String> fileContent = null;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
public class Operations {
private BufferedReader br;
public void lookForFiles() throws IOException {
FilenameFilter only = new FilenameFilter() {
import java.io.*;
public class MultiThreadTestDrive{
public static void main (String[] args) throws IOException {;
File file = new File("/Users/mastytchmac/IdeaProjects/HomeWorkLesson2_1/myInputDirectory/test.ddt");
System.out.println ("Обрабатываем файл: " + file.getName ());
Operations op = new Operations ();
op.lookForFiles ();
}