Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - 3man75

Pages: 1 [2] 3 4 ... 334
16
Forum Games and Roleplaying / Re: SPAMKINGDOM: Feodh of Luathbas!
« on: January 04, 2017, 06:46:14 pm »
A

Tell him to start putting together his own army soon to help with the lifting here or expect extra tithes to be paid...

17
Forum Games and Roleplaying / Re: SPAMKINGDOM: Feodh of Luathbas!
« on: January 04, 2017, 04:15:30 pm »
B

18
Forum Games and Roleplaying / Re: SPAMKINGDOM: Feodh of Luathbas!
« on: January 04, 2017, 03:17:09 pm »
PTW

19
I didn't mean to say buy a personal robot that can do your job for you...but kay.

What I mean is why would people support other huamans being ALIVE if they can all be replaced by bots? I know this is silly but if Hitler could replace everyone he killed with bots for his factories then theoretically the Germans would have lasted much longer. However, he coudn't. An after all of the political purges before and after taking power Hitler's Germany had manpower shortages.

Now this is theoretical but what if the 1% decide the world isn't big enough for the 99%? That's the question. Can they get away with letting us die or would they still need us to buy/consume products and services?

20
Just an idea.

If human work is automated than we could lose alot of jobs. Said humans may need to go back to school to learn and re-tool for newer jobs. But also if humans can just have these robots work then why work yourself?

My point being that if/me/us become obsolete than why would would it be needed for us to be around? Why would leaders WANT us around when some have expressed distaste for Blacks, Latinos, and Native Americans before? This is obviously american cenric but the same can be applied to Europeans and the Gypsies that are still hated over there.

From the point of my limited economists mindset, we the obsolete will fade. Just a thing I wanted to say earlier in the thread.

https://hardware.slashdot.org/story/16/10/18/194231/co2-to-ethanol-in-one-step-with-cheap-catalyst

Here's a happy one though. Oak Ridge National Laboratory have discovered a simple catalyst to turn CO2 + water directly into ethanol. And it's a government lab, so it won't be locked down with corporate patents.

Quote
The team used a catalyst made of carbon, copper and nitrogen and applied voltage to trigger a complicated chemical reaction that essentially reverses the combustion process. With the help of the nanotechnology-based catalyst which contains multiple reaction sites, the solution of carbon dioxide dissolved in water turned into ethanol with a yield of 63 percent. Typically, this type of electrochemical reaction results in a mix of several different products in small amounts. "We're taking carbon dioxide, a waste product of combustion, and we're pushing that combustion reaction backwards with very high selectivity to a useful fuel," Rondinone said. "Ethanol was a surprise -- it's extremely difficult to go straight from carbon dioxide to ethanol with a single catalyst."

Very nice stuff, the catalyst only uses common elements, it uses electricity (which could be from solar) to convert the CO2 directly into a usable alcohol. This could also compete against biofuels, which would reduce the pressure on farm lands while also reducing food price inflation. Turning CO2 from a waste product we can't get rid of, into a valuable commodity we use to make other things, is basically the holy grail.

Praise be to basic renewable resources.

21
General Discussion / Re: if self.isCoder(): post() #Programming Thread
« on: October 19, 2016, 05:42:58 pm »
Naming can be an issue for maintainability, but I mainly wanted to see evidence that you've acknowledged the core issue people brought up. I saw the renaming to "playerName" as not entirely conducive to believing you "got it".

As for remembering how to do things. Make program "templates" e.g. small programs/classes/functions that do that one thing as elegantly and generally as possible, in the least amount of code. Adhere to really clear naming conventions. Refer to those templates when you make new programs, classes or functions.

You're not expected to memorize boilerplate code. That's not how people operate. We have computers for that. The skill is to be able to see which chunk of boilerplate solution to apply where, then rename the "generic" names to specific names as needed (keep the generic names if it makes sense).

First issue. One too many scanners. Fixed.

playerName was never changed either because I forgot to. Want me to rename it? fine Scanner playerInpurDevice = new Scanner (System.in);

Done. I wish it was that simply said. Or maybe I lost the meaning in your paragraph again. I believe in bullet points more than anything when reading but hey this is free insightful help right?

So now that's over with I say this: Thanks.

This will be the last time you see me and i'm done. I'll go somewhere else or maybe a MOOC to learn.

What 3man75 needs is a minimal example. I recently started learning Java and I used to have the same issue. It is possible to create one Scanner object and use that throughout the entire class to parse both strings and integers. Here is how I do that:

Code: [Select]
import java.util.Scanner;

public class InputManager
{
private Scanner input;

public InputManager()
{
// Create a single scanner for this class (private Scanner input;) and initialize it.
// You can create a new Scanner for each method, but it is easier to reuse this one.
input = new Scanner(System.in);
}

public void run()
{
System.out.println("Type a number to add one. Type a string to make it uppercase. Type 'exit' to quit.");

// Keep looping the program over and over until the user inputs 'exit'
while(true)
{
// Get whatever the user entered as a String. It *might* be a number
String command = input.nextLine();

// Exit the program for this special case
if(command.equals("exit"))
System.exit(1);

// This is a try-catch block. It is how Java does error handling.
// If something inside the try{} fails to work, it will send out an exception.
// If an exception is sent out, the program will skip to the catch{} part.
// If nothing fails and everything goes OK, the catch{} block will be ignored.
try
{
// Our command is a string. Try to turn it into an integer.
// If this part fails, the program will immediately go into the catch{} block.
int number = Integer.parseInt(command);

// If the user input something like '123' then the previous line worked.
// Since we turned the command into an integer, we can now add to it and print it.
System.out.println("Your input plus one: " + (number + 1));
}
catch(NumberFormatException e)
{
// If the program fails to turn the command into an integer, it will go here.
System.out.println("Your input converted to uppercase: " + command.toUpperCase());
}
}
}
}

If you want to test this code, you can run it in main like this:

Code: [Select]
public class InputTester
{
public static void main(String[] args)
{
InputManager test = new InputManager();
test.run();
}
}

~snip~

Ninja'd: Just why did you make a private scanner int all the way in the bottom? I've never seen that before.

22
General Discussion / Re: if self.isCoder(): post() #Programming Thread
« on: October 19, 2016, 05:07:40 pm »
Scanners are there to take input from your keyboard. Kinda like Cin >> for C++

Names are indeed arbitrary but the point of contestion I think right now is why did I name it 'playerName' instead of something like 'input' or whatever to make it less likely to confuse me or a maintenance programmer down the road.

Basically instead of: Scanner playerName = new Scanner(System.in);

I should have made: Scanner inputDevice = new Scanner(system.in); or Scanner genericInput *rest of code*.


I'm mention this because in previous programs he made a separate scanner for each input statement he wanted.

He named each of the scanners after the thing he was going to input. He's still using that naming convention, so I was skeptical as to whether he actually gets it.

I hate my reputation too. I hate my inability to recall important tidbits after a week of not working on something over a weekend. Whether I'm getting better I can't say but to give you some insight about the job I posted..I had to leave.

Not because they didn't like me but because I was a student assistant and I had to also go to school for 6 credits per semester. FAFSA screwed me and money is tight so I wasn't able to sign up. Which forced me to drop that job.

Beleive it or not I was actually learning alot but I was still wet behind the ears. Printing issues? I got that in the bag and a metal box. stage set up? Check. Spanish speaking proffesors having issues with word? I know how to explain it for dum dums like myself.

New concepts? Not so much. But if I got better in that tech job I can do better in programming with time. Also the name of my department was network and media. Meaning I had to do media which was setting up for not so tech stuff and become a stagehand/roadie for whatever the event was. No more on this due to privacy and what not.

I actually felt like I left on a good note though so that's good. Not that it matters because yeah I'm a piece of shit of a worker and i'm 22 with alot of pre-reqs that I still have to take to transfer to a uni for my bachelors in C.science.

Now that that's out of the way reelya..

I still do like naming conventions for naming things on what i'm going to use them for. Yes, it's inefficient and I know that but I don't know how to name it without it being so damn generic that I don't know WHAT to use it for. Maybe i'm overthinking things and I should just generically named things like 'inputDevice' and just trace the code for hours in the future when my programs become bigger and more complex.

Kay, so how do I make that code box bigger for people to read? An again, I AM NOT GOING TO WORK ON THIS PROJECT ANY LONGER! I just want some advice on how I should build bigger things in the future. I don't have a system for organizing projects with classes or larger things. I don't know how to make things scalelable (the ability to continuously build on code without having to double back and rewrite your original code).





23
General Discussion / Re: if self.isCoder(): post() #Programming Thread
« on: October 19, 2016, 04:42:10 pm »
EDIT: Nvm...I just changed it to make player name the only inputter. I'm not sure why I did this because it's been so long. Maybe I just forgot to change it.

But why are you naming your scanner after the variable you want to input? What would you do if you wanted to use scanners to input player name and player age? Can you demonstrate that? Then I'll show you what you're not understanding.

Dosen't System.in take in any input whether they be a string or int (but not both of course)? I assume so because otherwise you would need a scanner for int, another for string, and maybe yet another for something like a double.

As for why I named it that I can say that I just don't remember. I built this project without a clear end point and built it up stage by stage and my naming of variables came with the need at the time. Specifically, I named each variable and scanner for what I needed at the time and not make it, um, more eternal.


EDIT: Nvm...I just changed it to make player name the only inputter. I'm not sure why I did this because it's been so long. Maybe I just forgot to change it.

But why are you naming your scanner after the variable you want to input? What would you do if you wanted to use scanners to input player name and player age? Can you demonstrate that? Then I'll show you what you're not understanding.
Yeah...

Bro come on. Theirs enough salt in the sound as is. I've been beating my head again for almost the whole day and I really could do without with one word answers that emphasize someone else's point. It's not helpful and it serves only to frustrate ppl.

24
General Discussion / Re: if self.isCoder(): post() #Programming Thread
« on: October 19, 2016, 12:25:07 pm »
You do not need a duplicate Scanner.  Like, ever.  Or at least, I've never seen it.

I'm putting my foot down: you've been told on at least three occasions now about the duplicate Scanners thing. you need to fix that before I'd even consider having a look at the rest. And by "fix" I mean rewrite the program, then edit your existing post with the improved version. Don't spam additional posts with the same code, because that will just clutter the thread, modify the old post with any improvements.

 If you ignored people about the scanners thing, how do I know that any advice I give you won't be ignored as well?

I seem to recall you saying something similar happened in your job: they got angry because you made the same mistake more than once. Be aware that you're doing the same thing to people in this thread. If you ever want a job as a programmer, they expect quick learners. The trick with being a so-called "quick learner" is to pay attention to what people tell you, then apply that. It's about actually paying attention to feedback.

Where am i re-using the scanner? An i'm not saying 'fix this for me' i'm asking how you would have made it better as in a general design concept. It's not meant to be 'add x codes' onto here rather 'you should have re-written this with y in mind' or something.

Again where am I re-using scanners?


Scanner inputSystem = new Scanner(System.in);
      Scanner playerName = inputSystem;

I did this above so that my scanner could send input to playerName which is for objects.

EDIT: Nvm...I just changed it to make player name the only inputter. I'm not sure why I did this because it's been so long. Maybe I just forgot to change it.

EDIT 2: Anyone know how to make the code boxes bigger? I have tiny little one sentence box that I can scroll which looks stupid.

25
General Discussion / Re: if self.isCoder(): post() #Programming Thread
« on: October 18, 2016, 10:59:18 pm »
Hey guys!

I just finished a very simple pokemon game on Java and I wanted to share it with all and ask what you think of it in terms of how it could have been made better. For the project I really wanted to work with oop, pointers, and anything else I felt was hugely important to the basics of programming in java.

In here is my main class/ tester where I run the code.
Spoiler (click to show/hide)

Spoiler (click to show/hide)

Again any thoughts or critique is appreciated since I know you all have your own things to do. Thanks for any help :)

26
General Discussion / Re: if self.isCoder(): post() #Programming Thread
« on: October 06, 2016, 01:20:31 am »
I honestly feel ashamed..*sigh*

Thank you Reelya. I

27
General Discussion / Re: if self.isCoder(): post() #Programming Thread
« on: October 06, 2016, 01:01:26 am »
Anyone ever have an issue where getting (using an actual getter for an object) gets you something, like an int let's say, but when you test to see if that int is 0 or below it fails to register?

Here's a code snippet btw

Spoiler (click to show/hide)

28
General Discussion / Re: if self.isCoder(): post() #Programming Thread
« on: September 13, 2016, 05:44:06 pm »
Hey guys, Im having an issue with elcipse where I deleted an old project in an attempt to start from scratch (it had problems with packaging for some reason).

Problem is that whenever I try to rename the project to what it was it says that theirs another project with that name. I know I can just rename it a bit different but i've gone on a warpath of sorts to complete destroy this 'original' that seems to be hiding somewhere. Somehow no matter how many times I go into my workplace folder and delete the 'new' project. After doing so I empty the recycle bin and go to name a new project with the same name but somehow it justs continues to say that a project can't be named that because theirs already one like it.

The cycle has gone for a couple minutes and I can't find where this file is located.

I'm using eclipse neon 4.6.0 and windows 10.

Anyone have this issue?

29
General Discussion / Re: if self.isCoder(): post() #Programming Thread
« on: August 18, 2016, 08:09:38 pm »
-snip-

Sounds like your primary problem is trying to run before you can walk. That space marine program you're talking about seems far more complicated than a dice rolling program.

I am in a somewhat similar situation to you, so I'll share my advice based on my own experiences.

Biggest advice I'd give is: Start projects small, and build up from there. I'm creating simple programs to test concepts that I may want to later implement in a game. First I get the concept to work. Then I generalize it so it can work when moved to other programs, environments outside of the testing program written specifically for the concept. Then test those concepts later in a separate project, or add new features to old projects, or etc. All of this work ideally could then be used in the future in a larger, more complicated project, and at the same time I'm developing skill at programming and planning programs/algorithms and debugging and etc, and those skills would definitely be useful for later more complicated projects.

edit: Ninja'd by Reelya, who said what I was trying to but in less words.

Possibly. So of all the things you know (I assume you know a lot and possibly have a C.S degree) do you remember it all as soon as you need it during planning or coding? I had to go back and look at some general code for how to get arrays and array lists to work for objects. I remember it existed but just not the actual synthax which feels embarrassing but I don't know what kind of 'level' i'm suppose to be on. Or what I should Aim for hence why I aim so high.

Anyways i'm going to go get sucked into some programming before the hour gets too late and I procrastinate again. Thank you all for your advice :)

EDIT: Ninja'd. The program was suppose to simulate how many people could successfully be turned into space marines to make a full chapter (which is 1000) people. Both 'human' and space marine would have to have been saved by two different arraylists (I think these would be better for memory than anything else I know). So say 1000 marines are made and then 10,000 people died failing to become space marines. There was also the fact that both human and space marine were objects with names, backgrounds, and stats each. I'll stop their. Suffice to say that my new projects will build up to it at another date. For now, make generic humans and put them into an array called a house.

Then have Pikachu fight a water pokemon with 1-4 attacks and 10 hp each. Then maybe something else. TBH I can see why the chapter master game that floats around is unfinished theirs just too many variables to keep track of!

Also I like the minium viable product idea. If it's one thing I (re?)learned today it's that building up is critical in programming.

30
General Discussion / Re: if self.isCoder(): post() #Programming Thread
« on: August 18, 2016, 07:40:40 pm »
I do actually like your idea Reelya. I've tried before but I think I know enough to create a wannabe pokemon go game.

Pages: 1 [2] 3 4 ... 334