Skip to content

Instantly share code, notes, and snippets.

View R3DHULK's full-sized avatar
🏠
Working from home

Sumalya Chatterjee R3DHULK

🏠
Working from home
View GitHub Profile
@R3DHULK
R3DHULK / TetrisGame.java
Created May 21, 2023 10:03
Tetris Game Written In Java Swing
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class TetrisGame extends JFrame {
private static final int BOARD_WIDTH = 10;
private static final int BOARD_HEIGHT = 20;
private static final int BLOCK_SIZE = 30;
private Tetromino currentTetromino;
@R3DHULK
R3DHULK / BreakoutGame.java
Created May 21, 2023 09:51
Break Out Game In Java Swing
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class BreakoutGame extends JFrame {
private static final int WIDTH = 480;
private static final int HEIGHT = 320;
private Ball ball;
private Paddle paddle;
@R3DHULK
R3DHULK / SudokuGame.java
Created May 21, 2023 08:46
Sudoku Game Board In Java
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class SudokuGame extends JFrame {
private static final int GRID_SIZE = 9;
private static final int CELL_SIZE = 60;
private static final int BOARD_SIZE = GRID_SIZE * CELL_SIZE;
private static final int[][] BOARD = {
@R3DHULK
R3DHULK / main.java
Created May 20, 2023 05:55
Snake Game In Java
import java.util.*;
import javax.imageio.ImageIO;
import java.util.Timer;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.io.*;
import javax.swing.*;
public class Main extends JFrame {
@R3DHULK
R3DHULK / Matrix.java
Created April 26, 2023 08:43
Matrix In Java
public class Matrix {
private int[][] data;
private int rows;
private int cols;
public Matrix(int rows, int cols) {
this.rows = rows;
this.cols = cols;
this.data = new int[rows][cols];
}
@R3DHULK
R3DHULK / hangman.java
Created April 26, 2023 08:36
Hangman In Java
import java.util.Scanner;
public class hangman {
private static final String[] WORDS = {"apple", "banana", "orange", "pear", "kiwi", "grape"};
private static final int MAX_TRIES = 6;
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String word = WORDS[(int) (Math.random() * WORDS.length)];
@R3DHULK
R3DHULK / Hangman.java
Created April 26, 2023 08:29
Hangman In Java
import java.util.Scanner;
public class Hangman {
private static String[] words = {"terminator", "banana", "computer", "cow", "rain", "water" };
private static String word = words[(int) (Math.random() * words.length)];
private static String asterisk = new String(new char[word.length()]).replace("\0", "*");
private static int count = 0;
public static void main(String[] args) {
@R3DHULK
R3DHULK / trivia.java
Created April 26, 2023 08:06
Trivia Game Written In Java
import java.util.Scanner;
public class trivia {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String[][] questions = {
{"What is the capital of France?", "Paris"},
{"What is the largest country in the world?", "Russia"},
@R3DHULK
R3DHULK / Main.java
Created April 26, 2023 07:54
Tic Tac Toe In Java
// A simple program to demonstrate
// Tic-Tac-Toe Game.
import java.util.*;
public class Main {
static String[] board;
static String turn;
@R3DHULK
R3DHULK / matrix.bat
Created April 11, 2023 17:26
Matrix In Batch Programming
@echo off
color 0a
mode 100,50
title Matrix
:matrix_loop
cls
setlocal enabledelayedexpansion
set /a "count=0"
for /l %%a in (1,1,50) do (