Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


mattnenterprise

Member Since 02 Sep 2007
Offline Last Active May 07 2014 10:00 PM

Topics I've Started

Android Math App

24 April 2014 - 08:59 PM

I have made a math based app for android to practice. I wanted some input on if any one would play this game.

 

PracticeApp_zps13e3e6ea.png

Here is an image of the game the user is given a grid of numbers. They are given a number to create and an operation. They must use that operation on two numbers from above to create the number assigned. After they create that number the blocks that contain those numbers are gone and all block move down that can move down. Then the the user is assigned a new number to create and a new operation. This repeats until the board is cleared or no moves are possible. The fastest time is only recorded when the board is actually cleared.

So would anybody actually play this? Any feedback would be greatly appreciated.


Sudoku

23 April 2014 - 06:25 AM

I created a Sudoku game in Java. I currently has 6x6, 9x9 and 12x12 size boards supported. It has a fully functional GUI. Here is a link to youtube to see what it looks like.

 

https://www.youtube.com/watch?v=vdaze934LeY


Connect Four Java LWJGL uses minimax Algorithm for AI

09 January 2013 - 03:55 PM

I recently made a Connect Four clone in Java using LWJGL. The game also uses the minimax algorithm for AI. The computer is pretty good but it also beatable. I made a video here it is

 

hopefully I can can get some feedback from it. If anyone wants the code just message me and I will sent it to you, just be warned that it is messy in places.


Word Search made using C++

17 May 2012 - 09:36 PM

Here is a game that I made using C++. I used SDL and OpenGL as libraries. Give me your opinions of how you like the game and any improvements I could make.

Minimax connect 4

16 April 2012 - 09:37 PM

I have been programming Connect 4 using Matlab and im using the minimax algorithm and when I play it it blocks be on on the horizontals, and vertical, but when I can when using diagonals it wont block me at all and I have no reason why. Here is my code.

function [ max ] = maxMove(BoardMax,depthMax,alphaMax,betaMax)
%UNTITLED2 Summary of this function goes here
%   Detailed explanation goes here
global bestMove;
max = -inf;
m = checkForWinner(BoardMax);
if(m)
	max = m;
elseif(depthMax >= 5)
	max = analysis(BoardMax);
else
  
%find all legal moves
legalMoves = findAllLegalMoves(BoardMax);
sizeOf = size(legalMoves,1);
%loop through all the moves
for i = 1:1:sizeOf
	%check for winner
	cMax = BoardMax;
	if(legalMoves(i,1) == 0)
		break;
	end
	cMax( legalMoves(i,1) , legalMoves(i,2) ) = 2;
	temp = minMove(cMax,depthMax + 1,alphaMax,betaMax);
	if(temp > max)
		max = temp;
		if(depthMax == 0)
		   bestMove = [legalMoves(i,1),legalMoves(i,2)];
		end
	end
	if(temp > alphaMax)
	   alphaMax = max;
	end
	if(alphaMax > betaMax)
	   max = alphaMax;
	end
end
end
  
end


function [ min ] = minMove(BoardMin,depthMin,alphaMin,betaMin)
%UNTITLED3 Summary of this function goes here
%   Detailed explanation goes here
global bestMove;min = inf;
m = checkForWinner(BoardMin);
if(m)
	min = m;
elseif(depthMin >= 5)
	min = analysis(BoardMin);
else
  
%find all legal moves
legalMoves = findAllLegalMoves(BoardMin);
sizeOf = size(legalMoves,1);
%loop through all the moves
for i = 1:1:sizeOf
	cMin = BoardMin;
	if(legalMoves(i,1) == 0)
		break;
	end
	cMin(legalMoves(i,1),legalMoves(i,2)) = 1;
	temp = maxMove(cMin,depthMin + 1,alphaMin,betaMin);
	if(temp < min)
		min = temp;
	   if(depthMin == 0)
		   bestMove = [legalMoves(i,1),legalMoves(i,2)];
	   end
	end
	if(temp < betaMin)
	   betaMin = min;
	end
	if(alphaMin > betaMin)
	   min = betaMin;
	end
end
endend

function [winner] = checkForWinner(Board)
global bestMove;
	winner = 0;
  
	% check for vertical win
  
	% loop through each column
	for j = 1:1:7
	   % check for four together in that column
	   for k = 1:1:3
		  % if four ones are together the human wins
		  if((Board(k,j) == 1) && (Board(k + 1,j) == 1) && (Board(k+2,j) == 1) && (Board(k+3,j) == 1))
			  winner = -500000;
		  %else if four twos are together the computer wins
		  elseif((Board(k,j) == 2) && (Board(k + 1,j) == 2) && (Board(k+2,j) == 2) && (Board(k+3,j) == 2))
			  winner = 500000;
		  end
	   end
	end
  
  
	% check for horizontal win
  
	%loop through each row
	for i = 1:1:6
		for k = 1:1:4
			if((Board(i,k) == 1) && (Board(i,k + 1) == 1)  && (Board(i,k + 2) == 1) && (Board(i,k + 3) == 1))
				winner = -500000;
			elseif((Board(i,k) == 2) && (Board(i,k + 1) == 2)  && (Board(i,k + 2) == 2) && (Board(i,k + 3) == 2))
				winner = 500000;
			end
		  
		end
	end
  
	% check for diagonal win left top to right down
  
	for row = 1:1:3
		for column = 1:1:4
			if((Board(row,column) == 1) && (Board(row + 1,column + 1) == 1) && (Board(row + 2,column + 2) == 1) && (Board(row + 3,column + 3) == 1))
				winner = -500000;
			elseif((Board(row,column) == 2) && (Board(row + 1,column + 1) == 2) && (Board(row + 2,column + 2) == 2) && (Board(row + 3,column + 3) == 2))
				winner = 500000;
			end
		end
	end
  
	%check for diagonal win right top to left down
	for row = 1:1:3
		for column = 7:-1:4
			if((Board(row,column) == 1) && (Board(row + 1,column - 1) == 1) && (Board(row + 2,column - 2) == 1) && (Board(row + 3,column - 3) == 1))
				winner = -500000;
			elseif((Board(row,column) == 2) && (Board(row + 1,column - 1) == 2) && (Board(row + 2,column - 2) == 2) && (Board(row + 3,column - 3) == 2))
				winner = 500000;
			end
		end
	end
end

This still needs coded
function [ whoWon ] = analysis(BoardAnalysis)
%UNTITLED Summary of this function goes here
%   Detailed explanation goes here
global bestMove;
	whoWon = 0;
end

function [ coordinates ] = findAllLegalMoves(Board)
%UNTITLED4 Summary of this function goes here
%   Detailed explanation goes here
global bestMove;
numberOfFutureMoves = 0;
coordinates(numberOfFutureMoves + 1,1) = 1;
coordinates(numberOfFutureMoves + 1,2) = 1;
for i = 1:1:7
   for j = 1:1:6
	  row = 0;
	  if(j == 1)
		 if(Board(j,i) ~= 0)
			 break;
		 end
	  end
	
	  if(Board(j,i) == 0)
		 if(j == 6)
			row = j;
			break;
		 end
		 continue;
	  elseif(Board(j,i) ~= 0)
		  row = j - 1;
		  break;
	  end
   end
   if(row ~= 0)
	   numberOfFutureMoves = numberOfFutureMoves + 1;
	   coordinates(numberOfFutureMoves,1) = row;
	   coordinates(numberOfFutureMoves,2) = i;
   end
end

   coordinates(numberOfFutureMoves + 1,1) = 0;
   coordinates(numberOfFutureMoves + 1,2) = 0;
end

And I hope this is enough information. Just ask if more information is needed.

PARTNERS