This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.swing.*; | |
import javax.swing.border.LineBorder; | |
import java.awt.*; | |
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import java.util.Objects; | |
public class AWT_TicTacToe implements ActionListener { | |
JFrame frame = new JFrame(); | |
JPanel titlePanel = new JPanel(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.*; | |
import java.awt.event.*; | |
import javax.swing.*; | |
class Player{ | |
String name, symbol; | |
boolean isWinner = false; | |
boolean myTurn = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Cursor; | |
import java.awt.Font; | |
import java.awt.event.ActionListener; | |
import java.awt.event.ItemEvent; | |
import java.util.function.Consumer; | |
import java.util.regex.Pattern; | |
import java.awt.Color; | |
import javax.swing.*; | |
import java.lang.Math; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// q no 1 | |
const int LED_ONE = 7; | |
const int LED_TWO = 12; | |
int prev_milli_one = 0; | |
int prev_milli_two = 0; | |
const int INTERVAL_ONE = 1000; | |
const int INTERVAL_TWO = 2000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int LED_ONE = 7; | |
const int LED_TWO = 12; | |
void setup() | |
{ | |
Serial.begin(9600); | |
pinMode(LED_ONE, OUTPUT); | |
pinMode(LED_TWO, OUTPUT); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool OnUserUpdate(float fElapsedTime) override | |
{ | |
Clear(olc::BLACK); | |
DrawSprite(fPlayerPositionX, fPlayerPositionY, sprPlayer.get()); | |
if (GetKey(olc::Key::LEFT).bHeld) { | |
fPlayerPositionX = fPlayerPositionX - fPlayerVel * fElapsedTime; | |
} | |
if (GetKey(olc::Key::RIGHT).bHeld) { | |
fPlayerPositionX = fPlayerPositionX + fPlayerVel * fElapsedTime; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define OLC_PGE_APPLICATION | |
#include "olcPixelGameEngine.h" | |
struct Enemy{ | |
float x; | |
float y; | |
bool alive; | |
}; | |
struct Bullet{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define OLC_PGE_APPLICATION | |
#include "olcPixelGameEngine.h" | |
struct Enemy{ | |
float x; | |
float y; | |
bool alive; | |
}; | |
struct Bullet{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <cctype> | |
#include <algorithm> | |
using std::string; | |
using std::vector; | |
enum operators {close = ')' , open = '(' , plus = '+' , min = '-' , mul = '*' , divide = '/', exp = '^'}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
class soccerPlayer{ | |
int jerNo,goals,assists; | |
public: | |
//constructor | |
soccerPlayer(int jer=0,int goal=0,int assist=0):jerNo(jer),goals(goal),assists(assist){} | |
bool operator >(soccerPlayer); |
NewerOlder