Page 24 of 43
Re: Programming, computers, etc. [Serious]
Posted: Sat Apr 27, 2013 10:50 pm
by Shai'tan
Anonymously Famous wrote:Aren't properly made Sudoku boards supposed to only have one solution?
Probably, but it was a requisite in case the board had too few filled squares to have one solution.
I was looking at my games folder today and I was wondering what to play. Not really having an idea I wished that I could choose one at random. Then it hit me, what if I made a program that did just that?
So I did, didn't take too long thanks to google. I present to you a random game chooser:
Code: Select all
import java.util.List;
import java.util.ArrayList;
import java.util.Random;
import java.io.File;
import java.io.IOException;
public class randomSelect {
List<String> fileFolder = new ArrayList<String>(1);
String path;
public static void main(String[] args) throws IOException{
randomSelect work = new randomSelect();
work.findFiles();
work.startFile();
}
public void findFiles(){
path = "C:\\Users\\Shai'tan\\Desktop\\Games";
String files;
File folder = new File(path);
File[] listOfFiles = folder.listFiles();
for (int i = 0; i < listOfFiles.length; i++)
{
if (listOfFiles[i].isFile())
{
files = listOfFiles[i].getName();
if (files.endsWith(".lnk") || files.endsWith(".url"))
{
fileFolder.add(files);
}
}
}
}
public void startFile() {
try{String runFile;
Random randomGenerator = new Random();
int index = randomGenerator.nextInt(fileFolder.size());
runFile = fileFolder.get(index);
String[] runThis = {"cmd", "/C",
"start \"\" \"C:\\Users\\Shai\'tan\\Desktop\\Games\\"+runFile+"\""};
Process p = Runtime.getRuntime().exec(runThis);
}catch(Exception e){
e.printStackTrace();}
}
}
The way it works:
1. Have a folder with shortcuts for games. (They usually end with .lnk or .url (Steam) )
2. Set the path to said folder equal to the path String in the program, add a \ for each \ in the path.
3. Javac randomSelect
4. Java randomSelect
findFiles is something I found on the internet, so I take no credit for that.
Re: Programming, computers, etc. [Serious]
Posted: Sun Apr 28, 2013 8:56 am
by atomtengeralattjaro
that's cool!

it could also be done with a batch file or script, though. (Not sure how, i'm not big on shell programming but it's definitely doable)
Re: Programming, computers, etc. [Serious]
Posted: Sun Apr 28, 2013 4:44 pm
by assdef
A program used to select a program?
Prograception?
Re: Programming, computers, etc. [Serious]
Posted: Sun Apr 28, 2013 5:35 pm
by atomtengeralattjaro
lots of programs use other programs to program the thing they are programmed to do.
Re: Programming, computers, etc. [Serious]
Posted: Sun Apr 28, 2013 9:25 pm
by Shai'tan
atomtengeralattjaro wrote:that's cool!

it could also be done with a batch file or script, though. (Not sure how, i'm not big on shell programming but it's definitely doable)
Probably and a lot easier too, but I decided to do it in Java, though it's harder since it's meant to be multiplatform.
Re: Programming, computers, etc. [Serious]
Posted: Sun Apr 28, 2013 10:05 pm
by atomtengeralattjaro
speaking of java,
my applet game university project is nearly complete, and i'll show it to you guys when it's ready. (at least those of you who are close enough to play without much lag)
until then, here's a screenshot:

- gameplay_ctf_2013-04-28.png (468.86 KiB) Viewed 4848 times
yes, it's a multiplayer top-down shooter about bugs with guns

i still don't have a name for it though, i thought of "Bug War", but apparently there is already a game with that name (it's a neat strategy game in flash). Any name suggestions?
Re: Programming, computers, etc. [Serious]
Posted: Sun Apr 28, 2013 11:13 pm
by Shai'tan
That looks awesome!
Don't know about name though, it's kinda hard to come up with something that isn't already used somewhere too.
Re: Programming, computers, etc. [Serious]
Posted: Sun Apr 28, 2013 11:51 pm
by ThingerDudes
"Top Down Shooter Game With Bugs But Not The Computer Kind Hopefully"
I am great at coming up with names.
Re: Programming, computers, etc. [Serious]
Posted: Mon Apr 29, 2013 12:05 am
by Shai'tan
It should definitely be an anagram, possibly of BUG(S).
Re: Programming, computers, etc. [Serious]
Posted: Mon Apr 29, 2013 7:58 am
by atomtengeralattjaro
Gubs? Sugb?
Re: Programming, computers, etc. [Serious]
Posted: Mon Apr 29, 2013 8:08 pm
by Anonymously Famous
That game selector would have been fairly trivial to program in Python.
Bugs ultimate graph shooter.
Re: Programming, computers, etc. [Serious]
Posted: Mon Apr 29, 2013 8:20 pm
by Shai'tan
Anonymously Famous wrote:That game selector would have been fairly trivial to program in Python.
Bugs ultimate graph shooter.
And probably in a lot of other programming languages, but I really only know Java
Big Underground Graphic Shooter.
Re: Programming, computers, etc. [Serious]
Posted: Mon Apr 29, 2013 10:32 pm
by Anonymously Famous
I should maybe try to get back into Java. It's been a long time.
Bugs Unite! Gun Shooter
Re: Programming, computers, etc. [Serious]
Posted: Tue Apr 30, 2013 7:38 am
by atomtengeralattjaro
Re: Programming, computers, etc. [Serious]
Posted: Tue Apr 30, 2013 2:21 pm
by Anonymously Famous
That might be cool. I wish it had generators.
Re: Programming, computers, etc. [Serious]
Posted: Tue Apr 30, 2013 2:27 pm
by atomtengeralattjaro
what are those?
(how about Bug Fight (or Bugfight) as a game name?)
Re: Programming, computers, etc. [Serious]
Posted: Wed May 01, 2013 10:55 am
by Shai'tan
Bug( )Fight sounds nice. Bugs with Guns is also kinda nice.
Re: Programming, computers, etc. [Serious]
Posted: Fri May 03, 2013 5:49 pm
by assdef
The question is...can they contain Lambda Lambda Lambda expressions?

Re: Programming, computers, etc. [Serious]
Posted: Mon May 06, 2013 7:32 pm
by Anonymously Famous
atomtengeralattjaro wrote:what are those?
http://wiki.python.org/moin/Generators
You can get by without them, but they come in handy.
Re: Programming, computers, etc. [Serious]
Posted: Thu May 16, 2013 9:43 pm
by atomtengeralattjaro
I just found out about an
off-road driving game that simulates mud. Holy shit, I mean, finally!