Skip to content

Instantly share code, notes, and snippets.

Avatar
💻
Coding and Hackathons

Mohd Akram Ansari mdakram28

💻
Coding and Hackathons
View GitHub Profile
View bash_commands.sh
# This is a comment
# 1. Print Directory Content
ls
# 2. Enter a Directory
cd <Directory>
# 3. Exit The current directory
cd ..
# 4. Crate a file
touch <filename>
View hello_world.c
#include <stdio.h>
int main() {
printf("Hello World\n");
return 0;
}
View ether
0x999Ac312D598Ab0Ac4C09463a6faf5C21A4A47Ec
View ex3.java
public void playNext1(){
ArrayList<Node> temp = new ArrayList<Node>();
//System.out.println(id+" : "+sub_nodes.size());
long max = sub_nodes.get(0).pref;
for(int i=0;i<sub_nodes.size();i++)
{
if(sub_nodes.get(i).pref > max)
{
temp.clear();
temp.add(sub_nodes.get(i));
View ex2.java
for(int i=0;i<9;i++)
{
layerFiles[i] = new File(l+(i+1)+".nodes");
if(!layerFiles[i].exists())
{
try{
layerFiles[i].createNewFile();
}
catch(Exception e)
{
View ex1.java
void playTurn(int pl,int turn){
while(TicTacToe.butClicked == 0);
switch(TicTacToe.butClicked)
{
case 1 : TicTacToe.state[0][0]=pl;break;
case 2 : TicTacToe.state[0][1]=pl;break;
case 3 : TicTacToe.state[0][2]=pl;break;
case 4 : TicTacToe.state[1][0]=pl;break;
case 5 : TicTacToe.state[1][1]=pl;break;
case 6 : TicTacToe.state[1][2]=pl;break;
View Layer.java
import java.util.ArrayList;
public class Layer {
ArrayList<Node> nodes = new ArrayList<Node>();
int layerNum = 0;
public Layer(int Num){
layerNum = Num;
}
View Node.java
import java.util.ArrayList;
public class Node {
ArrayList<Node> sub_nodes = new ArrayList<Node>();
String subNodes="";
String id="";
int pref = 0;
int n=0;
View Computer.java
import java.io.*;
import java.util.ArrayList;
public class Computer extends Player {
int t=0;
Node begin = new Node("000000000",0,this);
Node current = begin;
View Human.java
public class Human extends Player {
@Override
void playTurn(int pl,int turn){
while(TicTacToe.butClicked == 0);
switch(TicTacToe.butClicked)
{
case 1 : TicTacToe.state[0][0]=pl;break;
case 2 : TicTacToe.state[0][1]=pl;break;
case 3 : TicTacToe.state[0][2]=pl;break;