Skip to content

Instantly share code, notes, and snippets.

View GammaBurst101's full-sized avatar

Prasoon Pandey GammaBurst101

View GitHub Profile
/*
* This is the main class which will have the main method.
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class Main {
private JFrame frame;
private MyPanel graph;
private JPanel inputPanel;
@GammaBurst101
GammaBurst101 / Game.java
Created October 16, 2018 13:36
A simple stone, paper, scissors game
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Game {
private JPanel countdown, background;
private MyPanel move;
private JButton button;
private JLabel countdownL;
private Timer timer;
@GammaBurst101
GammaBurst101 / Game.java
Created September 2, 2018 12:00
A very simple command-line game
import java.util.Scanner;
public class Game {
public static void main (String args[]) {
Scanner scan = new Scanner(System.in);
while (true) {
System.out.println ("Write 'p' to start");
if (scan.next().equalsIgnoreCase("p"))
playGame();
import java.io.*;
import java.net.*;
class DailyAdviseServer {
String[] adviseList = {"Take smaller bites", "Go for the tight jeans. No You do not look fat in those",
"One word: inappropriate", "Just for today, be honest", "You might want to rethink the haircut"};
public static void main (String args[]) {
DailyAdviseServer server = new DailyAdviseServer();
/**
* User Input - 432
* Output - Four Hundred and Thirty-Two
*
* Note:- Input should be under 10,000
*/
package random;
import java.util.Scanner;
class Num {
public static void main (String[] args) {
@GammaBurst101
GammaBurst101 / PrimorialFinder.java
Created March 22, 2018 05:58
This java code finds the primorial of a number.
import java.util.Scanner;
class PrimorialFinder
{
public static void main (String args[])
{
Scanner scan = new Scanner (System.in);
System.out.println ("Enter the number");
int num = scan.nextInt();
long primorial = 1, factor = 1;
@GammaBurst101
GammaBurst101 / IPValidityChecker.java
Created March 20, 2018 17:03
This code can check whether an IP address is valid or not
import java.util.Scanner;
class IPCheck
{
public static void main (String args[])
{
Scanner sc = new Scanner (System.in);
System.out.println ("Please enter the IP address to check for its validity:");
String in = sc.next();