Off Topic > Off Topic

Programming Megathread

Pages: << < (105/241) > >>

Glass Joe:


--- Quote from: ZSNO on March 05, 2016, 02:11:29 PM ---For one, putting braces after a case statement is useless.

Anyways, http://pastebin.com/6EkTmsiJ
Basically you can have just an array of your tileset symbols, and access those directly instead of having a switch
As long as the inf.get() works correctly, the assignment statement is now one line
You can use the post increment operator (var++) to do the increment after the assignment, saving a line
You could figure out a better way to do the while(true) loop, because while(true)s are ugly
Also removed some #includes you had because they weren't used in this code.

--- End quote ---
Thanks, that tremendously slimmed down the code, but the inf.get() you mentioned doesn't quite seem to work.

(i added this section to it for testing purposes, it'll display the inputs)


Everything else though worked perfectly, though, so thanks!

ZSNO:


--- Quote from: Glass Joe on March 05, 2016, 03:03:31 PM ---Thanks, that tremendously slimmed down the code, but the inf.get() you mentioned doesn't quite seem to work.

(i added this section to it for testing purposes, it'll display the inputs)


Everything else though worked perfectly, though, so thanks!

--- End quote ---
Yeah, I'm usually not good at getting the input reading correct on the first go.

Gytyyhgfffff:


--- Quote from: Glass Joe on March 05, 2016, 03:03:31 PM ---Thanks, that tremendously slimmed down the code, but the inf.get() you mentioned doesn't quite seem to work.

(i added this section to it for testing purposes, it'll display the inputs)


Everything else though worked perfectly, though, so thanks!

--- End quote ---
is that a wii mouse cursor

McJob:


--- Quote from: ZSNO on March 05, 2016, 12:02:44 PM ---If you don't want to keep track of the array properties yourself, try using something like a vector or deque.

--- End quote ---
"deque" is something new to me. I only just learned about vectors when I did that tutorial last night. I was going through the RIT course notes.


So uhh, I don't know what to do. I'd like to get better at games programming and I'm decent at intermediate C/C++/C# but I don't know where to go to get better or what to do.

Glass Joe:


--- Quote from: Gytyyhgfffff on March 05, 2016, 04:30:25 PM ---is that a wii mouse cursor

--- End quote ---
ding ding ding
so after buttloads of testing, I finally got rid of the while loops in my tileset program and replaced them with lovey 2D for loops, which greatly cleans up the code

http://pastebin.com/sRkSCMqZ

Pages: << < (105/241) > >>

Go to full version