package io.github.galop_proxy.galop;

import com.google.inject.Guice;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

class EntryPoint {

    private static final Logger LOGGER = LogManager.getLogger();

    public static void main(final String[] args) {
        printWelcomeScreen();
        Guice.createInjector(new GalopModule()).getInstance(Starter.class).start(args);
    }

    private static void printWelcomeScreen() {
        LOGGER.info("Loading...\n\n" +
                "  _____________________ _______________   \n" +
                "  __  ____/__    |__  / __  __ \\__  __ \\  \n" +
                "  _  / __ __  /| |_  /  _  / / /_  /_/ /  \n" +
                "  / /_/ / _  ___ |  /___/ /_/ /_  ____/   \n" +
                "  \\____/  /_/  |_/_____/\\____/ /_/        \n\n" +
                getVersionLine() + "\n" +
                getDeveloperLine() + "\n\n");
    }

    private static String getVersionLine() {
        return center("Version: " + EntryPoint.class.getPackage().getImplementationVersion());
    }

    private static String getDeveloperLine() {
        return center("Developer: " + EntryPoint.class.getPackage().getImplementationVendor());
    }

    private static String center(final String s) {

        final int width = 42;

        String result = s;

        while (result.length() < width) {
            result = " " + result + " ";
        }

        return result;

    }

    private EntryPoint() {
        throw new AssertionError("No instances");
    }

}
@@ -31,16 +31,55 @@
 galop;%0A%0A
+import com.google.common.base.Strings;%0A
 import c
@@ -1340,25 +1340,24 @@
 h = 42;%0A
-%0A
         
 String r
@@ -1352,36 +1352,53 @@
     
-String result = s
+final int diff = width - s.length()
 ;%0A
-%0A
         
 whil
@@ -1397,115 +1397,167 @@
     
-while (result.length() %3C width) %7B%0A            result = %22 %22 + result + %22 %22;%0A        %7D%0A%0A        return result
+final int spaceWidth = (int) Math.ceil(diff / 2d);%0A%0A        final String space = Strings.repeat(%22 %22, Math.max(0, spaceWidth));%0A        return space + s + space
 ;%0A%0A 

Print welcome screen.