Game Instructions

Tap a tile to toggle its color. When a tile changes nearby tiles may change as well. Each move affect multiple tiles. The target is to turn all tiles into yellow in the fewest steps possible.

Press 'j' to show/hide the game. Press 'i' to show/hide the instructions. Press 't' to show/hide the top score table.

Steps: 0

Top Scores

Name Steps
Press J to toggle the game, I to toggle instructions, and T to toggle the top scores

Congratulations!

You solved the puzzle in 0 steps!

Success!

Score submitted successfully!

Error

Failed to submit score. Please try again.

The java.lang.IO Class in Java

Java Developer
Java 25 introduces the new java.lang.IO class, which provides us with a very small and convenient API for basic console input and output.

The java.lang.IO class lets us do simple input and output when running a program from the terminal. 

When it comes to simple output, then Instead of using the System.out.println well-known code snippet, we can do the following:

				
					IO.println("Hello, World!");

				
			

When it comes to getting some input from the user, then instead of setting up a Scanner, BufferedReader, or a Console, we can simply do the following:

				
					var name = IO.readln();
				
			

The IO Class

The java.lang.IO final class contains the definition of static utility methods, both for input and for output operations through System.in and System.out. 

				
					package com.lifemichael.samples;

import java.lang.IO;

public class IODemo {

    static void main() {
        String name = IO.readln("Your name: ");
        IO.println("Hello " + name);
    }
}
				
			

Compact Source Files

The java.lang.IO class is especially useful when using compact source files. The following code sample shows that. 

				
					void main() {
    var name = IO.readln("Enter your name: ");
    IO.println("Hello, " + name + "!");
}
				
			

Using compact source files together with the instance main() method, we can easily develop simple utility programs. 

Share:

Custom Gatherer

Creating a Custom Gatherer in Java

The gatherers allows us to define custom intermediate stream operations with their own state, processing logic, parallel-combination strategy, and finishing behavior. They are especially useful when standard stream operations are not expressive enough.

The CopyOnWriteArrayList Class

Working with CopyOnWriteArrayList in Java

The CopyOnWriteArrayList class is a thread-safe collection designed for cases in which reads are frequent and modifications are relatively rare. Its copy-on-write strategy makes iteration simple and safe, but writes come with an additional cost.

The Beauty of Code

Coding is Art! Developing Code That Works is Simple. Develop Code with Style is a Challenge!

Update cookies preferences