Compare commits

...

7 Commits

Author SHA1 Message Date
CoolGuy27
3963a55ac6 Resolve issues when pushing code to the remote repository
Add a file containing git commands and error messages related to handling divergent branches and setting up upstream tracking for the Chess repository.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: f6819c21-e85d-45ac-acde-604db2cfa4fe
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: d9940c32-e4d8-453f-8adb-85033b26737e
Replit-Helium-Checkpoint-Created: true
2026-04-20 20:29:57 +00:00
CoolGuy27
ee04740fef Add functionality to display a chess board and pieces
Adds new Java files for Chess game logic, piece representation, and display initialization, along with imports for GUI and event handling.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: f6819c21-e85d-45ac-acde-604db2cfa4fe
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: b3669ecc-6df5-4941-bb0c-6a0ed9bbd81e
Replit-Helium-Checkpoint-Created: true
2026-04-20 20:24:36 +00:00
CoolGuy27
8a0b1beae9 Add the Chess project by cloning it into a new directory
Correctly clone the Chess repository into a new directory, resolving remote origin conflicts and divergent branch issues.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: f6819c21-e85d-45ac-acde-604db2cfa4fe
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: edda13d1-827f-49cd-b2b5-43bd7ddfe30f
Replit-Helium-Checkpoint-Created: true
2026-04-20 20:23:56 +00:00
CoolGuy27
370264eb5e Add JetBrainsMono Nerd Font and unzip utility to the environment
Install unzip utility and JetBrainsMono Nerd Font package in the Nix environment.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: f6819c21-e85d-45ac-acde-604db2cfa4fe
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: bf130c8a-8757-4153-9c10-efa9db0b2d19
Replit-Helium-Checkpoint-Created: true
2026-04-20 19:38:47 +00:00
CoolGuy27
174a84b92a Update project files and configurations for game execution
Refactor Java source files, update level data, and modify replit.nix to include neovim and wget, while ensuring Java 21 is the primary JDK.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: f6819c21-e85d-45ac-acde-604db2cfa4fe
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 332f0015-659a-4183-b97b-e0f2e5f6cd83
Replit-Helium-Checkpoint-Created: true
2026-04-20 19:35:16 +00:00
CoolGuy27
82048663c2 Update project dependencies to use the latest Java version
Ensure the project uses Java 21 by updating the replit.nix configuration file.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: f6819c21-e85d-45ac-acde-604db2cfa4fe
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 84d583df-25bd-4291-b056-e06402231ebd
Replit-Helium-Checkpoint-Created: true
2026-04-20 19:01:11 +00:00
CoolGuy27
3658610a9f Update game to use the correct Java version and directory
Updated the project configuration to use Java 21 and run the game from the correct directory, resolving previous Java version conflicts and ensuring proper execution.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: f6819c21-e85d-45ac-acde-604db2cfa4fe
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: ed832e25-fc86-4753-8cfc-80cfabc64a02
Replit-Helium-Checkpoint-Created: true
2026-04-20 18:57:28 +00:00
93 changed files with 279 additions and 0 deletions

29
.replit Normal file
View File

@@ -0,0 +1,29 @@
[nix]
packages = ["adoptopenjdk-openj9-bin-16"]
channel = "stable-25_05"
[agent]
expertMode = true
[workflows]
runButton = "Project"
[[workflows.workflow]]
name = "Project"
mode = "parallel"
author = "agent"
[[workflows.workflow.tasks]]
task = "workflow.run"
args = "Start application"
[[workflows.workflow]]
name = "Start application"
author = "agent"
[workflows.workflow.metadata]
outputType = "vnc"
[[workflows.workflow.tasks]]
task = "shell.exec"
args = "cd /home/runner/workspace/American-Identity-Project && java Display"

View File

Before

Width:  |  Height:  |  Size: 281 B

After

Width:  |  Height:  |  Size: 281 B

View File

Before

Width:  |  Height:  |  Size: 140 B

After

Width:  |  Height:  |  Size: 140 B

View File

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 180 B

View File

Before

Width:  |  Height:  |  Size: 260 B

After

Width:  |  Height:  |  Size: 260 B

View File

Before

Width:  |  Height:  |  Size: 337 B

After

Width:  |  Height:  |  Size: 337 B

View File

Before

Width:  |  Height:  |  Size: 364 B

After

Width:  |  Height:  |  Size: 364 B

View File

Before

Width:  |  Height:  |  Size: 315 B

After

Width:  |  Height:  |  Size: 315 B

View File

Before

Width:  |  Height:  |  Size: 387 B

After

Width:  |  Height:  |  Size: 387 B

View File

Before

Width:  |  Height:  |  Size: 290 B

After

Width:  |  Height:  |  Size: 290 B

View File

Before

Width:  |  Height:  |  Size: 317 B

After

Width:  |  Height:  |  Size: 317 B

View File

Before

Width:  |  Height:  |  Size: 354 B

After

Width:  |  Height:  |  Size: 354 B

View File

Before

Width:  |  Height:  |  Size: 418 B

After

Width:  |  Height:  |  Size: 418 B

View File

Before

Width:  |  Height:  |  Size: 495 B

After

Width:  |  Height:  |  Size: 495 B

View File

Before

Width:  |  Height:  |  Size: 426 B

After

Width:  |  Height:  |  Size: 426 B

View File

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 180 B

View File

Before

Width:  |  Height:  |  Size: 261 B

After

Width:  |  Height:  |  Size: 261 B

View File

Before

Width:  |  Height:  |  Size: 264 B

After

Width:  |  Height:  |  Size: 264 B

View File

Before

Width:  |  Height:  |  Size: 312 B

After

Width:  |  Height:  |  Size: 312 B

View File

Before

Width:  |  Height:  |  Size: 249 B

After

Width:  |  Height:  |  Size: 249 B

View File

Before

Width:  |  Height:  |  Size: 301 B

After

Width:  |  Height:  |  Size: 301 B

View File

Before

Width:  |  Height:  |  Size: 311 B

After

Width:  |  Height:  |  Size: 311 B

View File

Before

Width:  |  Height:  |  Size: 274 B

After

Width:  |  Height:  |  Size: 274 B

View File

Before

Width:  |  Height:  |  Size: 286 B

After

Width:  |  Height:  |  Size: 286 B

View File

Before

Width:  |  Height:  |  Size: 392 B

After

Width:  |  Height:  |  Size: 392 B

View File

Before

Width:  |  Height:  |  Size: 223 B

After

Width:  |  Height:  |  Size: 223 B

View File

Before

Width:  |  Height:  |  Size: 307 B

After

Width:  |  Height:  |  Size: 307 B

View File

Before

Width:  |  Height:  |  Size: 313 B

After

Width:  |  Height:  |  Size: 313 B

View File

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 207 B

View File

Before

Width:  |  Height:  |  Size: 275 B

After

Width:  |  Height:  |  Size: 275 B

View File

Before

Width:  |  Height:  |  Size: 400 B

After

Width:  |  Height:  |  Size: 400 B

View File

Before

Width:  |  Height:  |  Size: 275 B

After

Width:  |  Height:  |  Size: 275 B

View File

Before

Width:  |  Height:  |  Size: 235 B

After

Width:  |  Height:  |  Size: 235 B

View File

Before

Width:  |  Height:  |  Size: 444 B

After

Width:  |  Height:  |  Size: 444 B

View File

Before

Width:  |  Height:  |  Size: 188 B

After

Width:  |  Height:  |  Size: 188 B

View File

Before

Width:  |  Height:  |  Size: 282 B

After

Width:  |  Height:  |  Size: 282 B

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 694 B

After

Width:  |  Height:  |  Size: 694 B

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

73
Chess/Chess.java Normal file
View File

@@ -0,0 +1,73 @@
import java.util.ArrayList;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.border.*;
import java.awt.Color;
public class Chess extends JPanel implements ActionListener{
//pieces stuff
ArrayList<Piece> white;
ArrayList<Piece> black;
//game vars
int boardWidth, boardHeight;
boolean whiteTurn;
Timer gameTimer;
Color creme = new Color(254,245,218);
Color brown = new Color(121,92,50);
public Chess(int boardWidth, int boardHeight){
this.boardWidth = boardWidth;
this.boardHeight = boardHeight;
setPreferredSize(new Dimension(this.boardWidth, this.boardHeight));
setBackground(Color.WHITE);
setFocusable(true);
white = new ArrayList<>();
black = new ArrayList<>();
for (int i =0 ; i <= 7; i++){
white.add(new Pawn(i+1,2,"White"));
}
for (int i =0 ; i <= 7; i++){
black.add(new Pawn(i+1,7,"Black"));
}
gameTimer = new Timer(200,this);
gameTimer.start();
repaint();
}
public void gameLoop(){
}
public void draw(Graphics g){
//draw board
for (int i = 1; i <= 8; i++){
for (int j = 1; j<= 8; j++){
g.setColor((i%2 == 1 && j%2 == 1 ) || (i%2==0 && j%2 == 0)? creme : brown);
g.fillRect(i * 40, j * 40, 40, 40);
}
}
//draw pieces
for (Piece p : white) p.draw(g);
for (Piece p : black) p.draw(g);
}
public void paintComponent(Graphics g){
super.paintComponent(g);
draw(g);
}
public void actionPerformed(ActionEvent e){
gameLoop();
repaint();
}
}

23
Chess/Display.java Normal file
View File

@@ -0,0 +1,23 @@
import javax.swing.*;
public class Display {
public static void main(String[] args) throws Exception{
//creating instance of JFrame
int boardWidth = 400;
int boardHeight = 400;
JFrame game = new JFrame();
game.setSize(boardWidth, boardHeight);
game.setVisible(true);
game.setLocationRelativeTo(null);
game.setResizable(false);
Chess chess = new Chess(boardWidth, boardHeight);
game.add(chess);
game.pack();
chess.requestFocus();
}
}
//images : https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQN6qOyhiUDLlTlwl19PaMTeiY5rSOqkUqu-g&s

10
Chess/Pawn.java Normal file
View File

@@ -0,0 +1,10 @@
import java.awt.*;
import javax.swing.ImageIcon;
public class Pawn extends Piece{
public Pawn(int x, int y,String color){
super(x,y,new ImageIcon("Sprites/" + color + "/Pawn.png").getImage());
}
}

18
Chess/Piece.java Normal file
View File

@@ -0,0 +1,18 @@
import java.awt.*;
import java.util.*;
public class Piece{
ArrayList<Integer> legalMoves;
int x,y;
Image sprite;
public Piece(int x, int y, Image sprite){
this.x = x;
this.y = y;
this.sprite = sprite;
}
public void draw(Graphics g){
g.drawImage(sprite,x * 40,y * 40,null);
}
}

View File

@@ -0,0 +1,47 @@
! [rejected] main -> main (non-fast-forward)
error: failed to push some refs to 'https://git.keshavanand.net/CT/Chess.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. If you want to integrate the remote changes,
hint: use 'git pull' before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
~/.../Chess/Sprites$ git pull
From https://git.keshavanand.net/CT/Chess
* [new branch] main -> origin/main
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=<remote>/<branch> main
~/.../Chess/Sprites$ cd ..
~/workspace/Chess$ git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=<remote>/<branch> main
~/workspace/Chess$ git pull origin main
From https://git.keshavanand.net/CT/Chess
* branch main -> FETCH_HEAD
hint: You have divergent branches and need to specify how to reconcile them.
hint: You can do so by running one of the following commands sometime before
hint: your next pull:
hint:
hint: git config pull.rebase false # merge
hint: git config pull.rebase true # rebase
hint: git config pull.ff only # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
fatal: Need to specify how to reconcile divergent branches.

View File

@@ -0,0 +1,70 @@
~/workspace$ ls
American-Identity-Project replit.nix
~/workspace$ mkdir Chess
~/workspace$ ls
American-Identity-Project Chess replit.nix
~/workspace$ cd Chess/
~/workspace/Chess$ git remote add origin https://git.keshavanand.net/CT/Chess.git
error: remote origin already exists.
~/workspace/Chess$ git -v
git version 2.50.1
~/workspace/Chess$ git remote -v
gitsafe-backup git://gitsafe:5418/backup.git (fetch)
gitsafe-backup git://gitsafe:5418/backup.git (push)
origin https://git.keshavanand.net/CT/American-Identity-Project (fetch)
origin https://git.keshavanand.net/CT/American-Identity-Project (push)
~/workspace/Chess$ git remote remove origin
~/workspace/Chess$ git remote add origin https://git.keshavanand.net/CT/Chess.git
~/workspace/Chess$ git remote -v
gitsafe-backup git://gitsafe:5418/backup.git (fetch)
gitsafe-backup git://gitsafe:5418/backup.git (push)
origin https://git.keshavanand.net/CT/Chess.git (fetch)
origin https://git.keshavanand.net/CT/Chess.git (push)
~/workspace/Chess$ git pull
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 6 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (6/6), 1.66 KiB | 1.66 MiB/s, done.
From https://git.keshavanand.net/CT/Chess
* [new branch] main -> origin/main
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=<remote>/<branch> main
~/workspace/Chess$ ls
~/workspace/Chess$ ls
~/workspace/Chess$ ls -ls
total 0
~/workspace/Chess$ ls -la
total 0
drwxr-xr-x 1 runner runner 0 Apr 20 20:21 .
drwxr-xr-x 1 runner runner 154 Apr 20 20:21 ..
~/workspace/Chess$ git pull origin main
From https://git.keshavanand.net/CT/Chess
* branch main -> FETCH_HEAD
hint: You have divergent branches and need to specify how to reconcile them.
hint: You can do so by running one of the following commands sometime before
hint: your next pull:
hint:
hint: git config pull.rebase false # merge
hint: git config pull.rebase true # rebase
hint: git config pull.ff only # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
fatal: Need to specify how to reconcile divergent branches.
~/workspace/Chess$ git remote -v
gitsafe-backup git://gitsafe:5418/backup.git (fetch)
gitsafe-backup git://gitsafe:5418/backup.git (push)
origin https://git.keshavanand.net/CT/Chess.git (fetch)
origin https://git.keshavanand.net/CT/Chess.git (push)
~/workspace/Chess$

9
replit.nix Normal file
View File

@@ -0,0 +1,9 @@
{pkgs}: {
deps = [
pkgs.unzip
pkgs.nerd-fonts.jetbrains-mono
pkgs.neovim
pkgs.wget
pkgs.jdk21
];
}