Author Topic: SEGAbits programming topic // master race code experts  (Read 15974 times)

Offline Happy Cat

  • *
  • Posts: 3856
  • Total Meseta: 48
SEGAbits programming topic // master race code experts
« on: August 04, 2014, 08:05:23 pm »
I'm in the process of increasing my understanding of JavaScript and thought it would be fun to see if there was any other programmers here on bits. Maybe we could help eachother and give advice on things we are stuck on. Even with different syntaxes, programming languages share the same core concepts.

If you aren't familar with programming languages and are feeling brave check out this ebook with examples you can interact with. it's great. Is what I am studying off of at the moment.

http://eloquentjavascript.net/index.html

also programmers are indeed the master race of our modern day world. without them.. well.. we'd be pretty screwed.
« Last Edit: August 04, 2014, 08:15:16 pm by Will »

Offline JRcade19

  • *
  • Posts: 550
  • Total Meseta: 6
Re: SEGAbits programming topic // master race code experts
« Reply #1 on: August 04, 2014, 09:28:34 pm »
Desktop Class reporting in.

"Some" Knowledge of Javascript
Average knowledge of C++
Above average understanding of Visual Basic(lol)
Currently self teaching C, soon to add Java.

Very basic knowledge of MS-DOS Assembly Syntax. Will probably seek to learn UNIX-style assembly for applicability.

Dev tool is currently Orwell Dev C++, or Visual Studio may add Netbeans(For Java) to supplant Eclipse, or switch to code::blocks. Vim and Cygwin may also be acquired however I'm unsure of those.
« Last Edit: August 04, 2014, 09:37:48 pm by JRcade19 »

Offline Randroid

  • *
  • Posts: 515
  • Total Meseta: 15
Re: SEGAbits programming topic // master race code experts
« Reply #2 on: August 05, 2014, 02:32:23 am »
Yeah, I'm a web-dev professionally and a hobbyist Android Game developer (So decent with Java, C++ and C#). Good to see some devs here. Maybe we can make this thread a mini Stack.

Offline JRcade19

  • *
  • Posts: 550
  • Total Meseta: 6
Re: SEGAbits programming topic // master race code experts
« Reply #3 on: August 05, 2014, 11:08:44 am »
Might as well add some resources book wise. These are what I'm using.

The C Programming Language(Second Edition Post ANSI) - Colloquially known as "The C Bible". Frankly for such a small book, it's not leaving any stone untouched so far. It really is quite comprehensive. An old book granted(Current standard is C11) but it still remains a fascinating read as I go through it.

The Practice of Programming - Most examples in this book are less about language learning and more about applicability. Most Examples I've noticed so far are in C/C++ and Java.

Elements of Programming Style - This book cost me an arm and a leg for a used copy(granted it was in good condition). Mainly skimming this book, it centers on habits and writing code that isn't worthless the minute the original author stops writing it. Programs in this book take a bit of getting used to, as they are written in Fortran or PL/I rather than C.

Microcontrollers: High Performance Systems and Programming- Got this as a gift from one of my professors(He's the author). C and Assembly lessons mostly. Haven't skimmed this one too much.

Introduction to Java comprehensive Version(6th edition) - Haven't really started much on this one yet due to C cravings, but as you can tell, it too is a bit dated. I will have to make up for this gap elsewhere.

And Finally Both the Beginning and Professional Android 4.X development books. Like it's Java twin, I haven't really touched on these yet as I'd rather get some C going first.

Still will be looking to pick up more books, but that will have to wait until I have a steadier income. Just thought I'd share these anyway.
« Last Edit: August 05, 2014, 11:14:32 am by JRcade19 »

Offline RegalSin

  • Banned
Re: SEGAbits programming topic // master race code experts
« Reply #4 on: August 05, 2014, 09:01:26 pm »
I like your programming things; I do not like the "master race" in the topic title. or any word of that. So I am ranting about the title. Everybody does their part, so people should cut it out with the master bullcrap.

Programmers are not the master race of anything. They are slaves of the current trends soon to be outdated. People do not need computers at all; they need products. Products that are dime a dozen. Only a few programmers ( which I doubt is on this form ) can actually use their knowledge to anything amazing or interesting that would wow most people.

To make things worst many programmers are working against privacy and rights of people. They call it making a living because they do not really use the computer for anything; but they understand how it works. Seriously stuck inside of a room with air conditioning; and a face full of math. Hurray. Whoopie. No danger; just

The only reason a person could code; is because they have nothing ( nothing worth mentioning ); that they do at all. Oh look this person turns a knob; that person changes a tire. Just qualification after qualification.

If you want to call yourself a master skilled worker; or something along that lines. I am sorry you fail. The only reason why people like computers ( the majority ) is because of the media they use with it ( videogames, etc ). That time has gone now. People are getting sick of computers more and more often. In a world ( a sad world ) where we do not print books and we have cybernetic implants; yes programmers will be around.

As
a squaresoft employee said "Without the comics ( Manga ) videogames would cease to exsist".
That is what programmers are. People who make those magnificent works of art show up on the screen. Looking back a majority of artwork is what turned people heads to even purchasing or playing videogames at all.

In fact the only reason I want to play "Final Fantasy" ( or most FF games ) is the creative content; that communicates with the purchaser. They are speaking my language ( in terms of creative content ). I mean we got creative stuff in the west as well; but they aren't doing that comic book thing they do in the east. If so it is mildly being done. I mean yeah the material is bland but it communicates with me.

Speaking of which FF12 battle system makes the game boring. It is adopted from the MMORPG game. However never have I seen such beautiful characters, and beautiful world and CGI in an long long time. I can even stand to listen to the English langauge version of it; because the acting is actually good and not commercial Disney highschool bs FFX acting blows and makes you want to mute the entire game. If I heard or saw bs about programming would you think I would pick up the game alone? Look at .Hack the PS2 game ( great big game, but barely anything hacker about it asides Digimon.

You think we cared about Yuji Nanka and Megaman creator? No. We cared about the ficiton that was before our eyes. Videogames are nice but without the creative content; everybody would be a lot faster, spend less money. Thanks to a writer, cartoonist, and animators, we got see dancing Robotnik and other Wacky Sonic characters. All a programmer did was made us control the action of Sonic.

I am not dissing programming. I am just saying programmers are no master anything. Guess what? In my neck of the woods; their are tons of people with programming bachelors ( which I might end up with as well ) and nobody wants them. They just outsource and most people who do the work are barely enjoying anything from it.

I look at programmers and they are doing work; nobody wants to do with their programming skills.
So the way I see things; great you got work; your happy. Nice atmosphere, but remember nobody brought SEGA goods for their programming efforts.

End of rant
.
.
.
End of line


About books mentioned

I have the
Program Language C ( ANSI C ) Brain W
etc etc right next me. It is setting next to my other non-related book. It is very interesting book to read. When I go back into it; I will talk more logic about it.

Only books I have is

Programming Assembler 5 ( typical textbooks )
Problem sloving with C ( basically C++ intro course book )
Building Java programs ( useful book for begininers )
A first book of C++ ( basicall Problem Solving but it is C++ ).


I have some more but I doubt I will use them as of yet.

Bottom_line you can't even program no matter what book you have.
You need the kit ( Developers Kit, and manual
( whatever it is called ); that comes with an computer/machine. All knowing program is just makes it easier on the eyes to translate. Take the unofficial devkits for the PCE and genesis.

Yeahhhhhhh.......... Another about programmers a lot of ( as far as I remember ) them are religious folks apparenlty in some cult or congregation. I am talking west wise. I mean the good top programmers. Also I don't get, why many programmers come off as jerks to everybody. So far two people into games act like jerks ( in response to me, in the past ) and they make programs for  things I love.

I keep saying this to myself. If I was in Japan; like a native I would have no problem in putting together a crack team of people and making something.

Without procrastinating programmers wouldn't have nothing else in their lives. Stop that MR bs.
I don't mean to be rude ( the irony ) but programming is only needed because people are addicted to products. It is dumbing down our society everyday.
« Last Edit: August 05, 2014, 09:28:40 pm by RegalSin »

Offline Happy Cat

  • *
  • Posts: 3856
  • Total Meseta: 48
Re: SEGAbits programming topic // master race code experts
« Reply #5 on: August 05, 2014, 09:49:51 pm »
Wow. Randroid and JRcade, you both have impressive skills it seems. That is great!

I understand how arrays and objects work, but this has got my head spinning. I'm happy the guy is going so in depth with the theory though. None of the other books or sources I've used to learn JavaScript talk about theory of how things work. Which is what I need to learn to increase my understanding.

I like your programming things; I do not like the "master race" in the topic title. or any word of that. So I am ranting about the title. Everybody does their part, so people should cut it out with the master bullcrap.

RegalSin, it was kinda just a bit of sarcasm. You know how PC gamers call themselves the master race, it was a spin on that.  It is true though that without programmers we'd still be living in the stone ages. Programmers are essential to everything that happens in the modern world.

Edit: Google just hired me for my l33t coding skills. I guess I get to spy on you now, RegalSin :) High up from master race google towers.
« Last Edit: August 06, 2014, 02:35:17 am by Will »

Offline RegalSin

  • Banned
Re: SEGAbits programming topic // master race fail
« Reply #6 on: August 06, 2014, 07:51:05 am »
Again your not any master race at all.

Google is an market research company. However it has been viewed working with law enforcement.
Various companies sells ( meaning as in sales ) your private information to the goverment. However the goverment bypasses this and forced people to give their private information; so they could just walk in and spy on you.

Without technology???? Computers for the commoner wasted money and created more problems for people then they ask. Imagine Apple computer users; why Apple? Well because you do not have to do the ruff work in order to get books printed. For graphic designers they can play around with it. Amiga was the same thing as well. Then when it comes to the artist it is a major slow down.

Why DOS or Microsoft? So a person could manage money? A person manages money far more better on paper then with computers. They just have a really fancy calculator.

Same thing with the stock market. All that did was open up new markets to new people. However back in the 1970's anybody could walk into that room and get a number and follow procedures.

What else is their? Automated systems? Remember Y2K scare. A man pulled out his money and was robbed on the way home. Banks can lie about how money they have all the time. And so forth.

Bottom-line right now ( just right now ) r-tard phones are dirt cheap and everybody thinks they need one. It is so stupid that when they show you how to drain the poison from a snake bite. They just say "Do nothing and call for help" What if you needed help right now? What if your phone died on you. You have tons of parents who is getting help from the computer for child care. They sit at the machine and then get distracted by candy crush, while their child needs medical attention ( even the smallest attention a parent could use from the kitchen. ).

Recently a famous hacker was assassinated after he showed the world on stage ( with his friend ); that an wireless pace-maker frequency could be hacked into. They found him dead at his desk??? Imagine all the diplomats with wireless pace-makers right now??? We have drones ( dickless hovering flying bastards ) that can give a person a ticket and demand not to be touched. We have people who instead buy a videogame; try to make their r-tard phones an all in one.

Speaking of dating nobody wants to talk to anybody anymore. They want to go on facebook. It is sad.

Okay great Google hired you. Oh that is so nice; their are tons of other places that are probably far more respectable; however I guess if they hire you and all.

Without technology; I wouldn't have had an home invasion. Without technology you wouldn't get tickets for having your r-tard phone on your dashboard. Without technology I could talk to the opposite sex like a normal person. Without technology I would have saved tons of money.

It is only a temporarily needed thing.

« Last Edit: August 06, 2014, 07:55:02 am by RegalSin »

Offline Happy Cat

  • *
  • Posts: 3856
  • Total Meseta: 48
Re: SEGAbits programming topic // master race code experts
« Reply #7 on: August 06, 2014, 11:28:04 am »
I don't really work at Google. I only said such as a joke. My coding skills have a long ways to go before I ever get a job at Google. :)

Anyways, we should probably get back on topic.

Offline JRcade19

  • *
  • Posts: 550
  • Total Meseta: 6
Re: SEGAbits programming topic // master race code experts
« Reply #8 on: August 06, 2014, 11:36:34 am »
This is a very simplistic Pizza deal calculator that I made for a final project in the principles of programming class. I haven't rewritten it personally yet, but one can probably use a header file or function here to shorten the overall code size.

It takes the # of pizza's, takes their Diameters and prices and determines which of 2 user defined deals is superior.

Again, this is a rather old program I haven't rewritten but it can be done(I might do so myself down the line).

Language is C++

Code: [Select]
// Final project: Pizza Calculator
// Jose Rodriguez
// Principles of Programming
#include <iostream> // basic input/output library
#include <float.h> // library needed for float functions relating to decimals
#include <iomanip>
#include <cstdlib> // suspends program for viewing purposes
using namespace std;
int main () //initializes the program
{
    int number; // declares numeric variables
    float diameter; // measurement from which radius and thus area will be derived
    float Totaldiameter; //the total diameter of both single and multiple pizzas
    float price; // the input price for single or multiple pizzas
    float result1; // the result of the first value calculation
    float result2; // the result of the second value calculation
    float radius; // half of diameter and measurement used for area
    float area; // used ultimately for value proposition calculation
    int step =1; // begins the primary setup
    const int pi =3.14; //declared constant interger of pi for forumalic reasons
   
    cout << "Pizza Deal calculator for penny pinchers and consumerists alike!" << endl; // primary greetings
    cout << "This program is designed, whether by penny pinching or consumerism, to save you money!" << endl; //brief purpose explanation
    cout << "Please follow the instructions prompted on the screen below you" << endl; // instructions to begin
    cout << "\n";
{
    cout << "\n";
    cout << "please input the information requested" << endl; // further instructions
    cout << "\n";
    cout << "Enter quantity of pizzas: " << endl; // prompts user to input pizza quantity
    cin >> number; // number input by user
    cout << "\n";
    cout << "Approximate size of the pizza(s)(Diameter in inches): " << endl; //prompts user to input diameter measurement
    cin >> diameter; // user input diameter
    Totaldiameter=(diameter*number); // diameter measurement across single or multi pizzas
    radius=(Totaldiameter/2); // formula required to extract radius from diameter
    area=(3.14*radius*radius); // formula required to obtain area measurement
    cout << "\n";
    cout << "Price of the first Pizza: $" << endl; // prompts user for cost input
    cin >> price; // input cost
    result1=(price/area*number);
    cout << "\n";
    cout << "The First Pizza dea is valued at: $ " << result1 << " per square inch"; // informs user of numeric value of proposed deal
   
}
{
    int step =2; // initiates the second calculation
   
    cout << "\n";
    cout << "\n";
    cout << "\n";
    cout << "\n";
    cout << "please input the information requested" << endl;
    cout << "\n";
    cout << "Enter quantity of pizzas: " << endl;
    cin >> number;
    cout << "\n";
    cout << "Approximate size of the pizza(s)(Diameters in inches): " << endl;
    cin >> diameter;
    Totaldiameter=(diameter*number);
    radius=(Totaldiameter/2);
    area=(3.14*radius*radius);
    cout << "\n";
    cout << "Price of the Second Pizza: $" << endl;
    cin >> price;
    result2=(price/area*number);
    cout << "\n";
    cout << "The Second Pizza deal is valued at: $ " << result2 << " per square inch";
    cout << "\n";
    cout << "\n";
    cout << "Please press enter to proceed" << endl; // prompts user for key input
    cin.ignore().get(); // needed for program pause
}
{
    cout << "\n";
    cout << "\n";
    if (result1 < result2) // conditional statement declaring possible event
    {
    cout << "The first deal is triumphant and superior. Go number one!"    << endl; // output if event is verified
    }
    else if (result2 < result1) // secondary conditional statement in opposite of the first
    cout << "The challenger wins! Go number two!" << endl; // statement output if verified
}   
std::cin.get();}; // keeps program open unless further input is made


Offline RegalSin

  • Banned
Re: SEGAbits programming topic // master race code experts
« Reply #9 on: August 07, 2014, 05:57:14 pm »
If you really want to show ( thanks for the example above ). Then you should checkout the PCE devkit that somebody made. So far there a couple of people using it to make games for it. I know the Genesis have one; but it something nice to mess with.

If anybody into PCE. I am still trying to figure out BIG SPRITES. For that system. Where you pile them on top of each other; so it draws the four smaller sprites; as on big sprite.

Offline JRcade19

  • *
  • Posts: 550
  • Total Meseta: 6
Re: SEGAbits programming topic // master race code experts
« Reply #10 on: August 07, 2014, 06:07:45 pm »
I will check out the PCE dev kit when I can given the recommendation

In the mean time here is another rather simple and vanilla program I had written for school again. It takes the number of patrons, the total bill for the meal and calculates both the whole tip and tip per person based on 16 and 20 percentiles.
One only need modify the percentage values to change the results based on desire.

Language is again C++ and please note that most of my submissions for the time being may just be console applications. GUI isn't really covered in the beginning segments, merely acknowledged(Though I am experimenting on my own as well).

Edit: The "Values tested" comments at the bottom aren't indicative of answers, so don't expect them to be exactly like when you use the program.

I'll give an actual example that is verified:

Quote
5 patrons
$100 Bill
20% Tip = $20
20/5= $4 per person.

Code: [Select]
/* Jose Rodriguez
Dividing the Dinner Bill Program
COP 2334 C++ Programming
*/
#include<iostream>
#include<float.h>
#include <cstdlib>
#include <iomanip>
using namespace std;
int main()
{

   int Patrons; // number of friends including the user of the program
   float Bill; // uses float point values to determine most approximate cost. Also allows for monetary input via decimal.
   float TipBase; // Base Tip amount before dividing
   float Tip16; // used to define the approximate tip cost based on percentage(16)
   float Tip20; // used to define the approximate tip cost based on percentage(20)
   
cout << "Thank you for using our Bill division program" << endl; // greeting text
cout << "**************************************" << endl; // title line
cout << "\n"; // blank space
cout << "Please input the total number of patrons who plan to contribute" << endl; // user prompt for individual number prompt
cin >> Patrons; // number of friends dividing the bill
cout << "\n";
cout << "Thank you. Please input the total amount due" << endl; // prompts user for total bill
cin >> Bill; // total bill input
Tip16= Bill*0.16; // formula to extract the base tip 16% as a whole
TipBase= Tip16/Patrons; // Formula to extract the base tip per individual at 16%
cout << "\n";
cout << setprecision(3) << "Your total tip amounts to: $ " << Tip16 << endl; // output Bill split Calculations
cout << setprecision(3) << " Alternatively " << "$ " << TipBase << " Per Individual based on a desired 16% " << endl; // Individual calculation off of TipBase
cout << "\n";
Tip20= Bill*1/5;
TipBase= Tip20/Patrons; // Formula to extract the base tip per individual at 20%
cout << " OR " << endl;
cout << "\n";
cout << setprecision(3) << "Your total tip amounts to: $ " << Tip20 << endl;
cout << setprecision(3) << " OR " << " $ " << TipBase << " Per Individual based on a desired 20% " << endl;

system("pause");} // Offers pause and ends program upon the pressing of any key

/* Values Tested
4 patrons, $100
3 Patrons, $90
5 patrons, $125.37
6 patrons, $55.72 */
« Last Edit: August 07, 2014, 06:13:22 pm by JRcade19 »

Offline Happy Cat

  • *
  • Posts: 3856
  • Total Meseta: 48
Re: SEGAbits programming topic // master race code experts
« Reply #11 on: August 07, 2014, 09:45:37 pm »
Thanks for the neat examples. I really have no clue whats going on in them cause I'm not familar with the C++ syntax.

Offline JRcade19

  • *
  • Posts: 550
  • Total Meseta: 6
Re: SEGAbits programming topic // master race code experts
« Reply #12 on: August 07, 2014, 09:58:17 pm »
Thanks for the neat examples. I really have no clue whats going on in them cause I'm not familar with the C++ syntax.

#include means I'm including an external library or header file in my program.

iostream is the basic input/output stream needed for anything to pop up at all or even function haha
float is a library that handles floating point numbers for decimal calculations, iomanip helps with that.
cstdlib is a general function library spreading across many functions.

Using Namespace STD basically makes it so I don't have to type "std::" in front of every input/output promp.

int main = initialize main(ergo where the program more or less starts)

float declares an expected floating point number(decimal)
int declares a whole number(interger)
cout(see out) basic output operation, outputs text or desired function to the screen
cin(See in) basic input operation

endl: Ends the current line, otherwise your text would go on forever on a single line lol.

All other text is most likely a declared variable.

Offline Happy Cat

  • *
  • Posts: 3856
  • Total Meseta: 48
Re: SEGAbits programming topic // master race code experts
« Reply #13 on: August 08, 2014, 12:22:40 am »
Ooh...! i understand now. thanks for the short syntax explanation. Those are actually quite simple programs. Just the whole different syntax making them look complex to me.

Offline JRcade19

  • *
  • Posts: 550
  • Total Meseta: 6
Re: SEGAbits programming topic // master race code experts
« Reply #14 on: August 08, 2014, 01:44:31 pm »
Sharing time!

This one is dead simple and not very applicable to many things.

This program basically displays the definition of a term when clicked. It will ONLY display the definition of that one term, and when another term is selected the previous term will be hidden.

Language here is Visual Basic. Keep in mind that the Lines containing classes and subs were all generated by Visual studio itself when I placed GUI objects down via the visual editor. The variables and comments below the subs and classes, as well as the close() function I did by hand however as computing hasn't become that lazy yet lol.

comments in visual basic are marked by an apostrophe (')
Variables are shorthanded
lbl = label
btn = button


Code: [Select]
' Program Name: Term Overview
' Developer: Jose Rodriguez
' Purpose: The purpose of this Program is to offer
'          a brief overview of the 3 predefined terms
'          for study purposes.
'          By default, the user should see no terms.
'          By clicking on the various buttons located
'          on the page, the user will reveal definitions
'          only related to the term however, not all at once.

Public Class frmTermOverview
    ' This is the basic GUI windows form through which the user interacts with the application

    Private Sub picComputer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles picComputer.Click
        ' Picture of Computer and related components
        ' There is no special purpose for this image.
        ' It exists only as a visual moniker

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnComputerHardware.Click
        ' This button is the first among which the user may click on to reveal a term
        ' This code is executed when the user clicks on the first button.
        ' When it is executed the definition of only "Computer Hardware"
        ' will be revealed, while the other two remain hidden.
        ' Once the user clicks any of the other two buttons
        ' This definition will disappear, and only the requested
        ' definition shall be displayed.

        lblComputerHardware.Visible = True
        lblDeveloper.Visible = False
        lblRapidApplicationDevelopment.Visible = False
        btnComputerHardware.Enabled = True

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDeveloper.Click
        ' This button is the second among which the user may click on to reveal a term
        ' This code is executed when the user clicks on the first button.
        ' When it is executed the definition of only "Developer"
        ' will be revealed, while the other two remain hidden.
        ' Once the user clicks any of the other two buttons
        ' This definition will disappear, and only the requested
        ' definition shall be displayed.

        lblComputerHardware.Visible = False
        lblDeveloper.Visible = True
        lblRapidApplicationDevelopment.Visible = False
        btnDeveloper.Enabled = True
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRapidApplicationDevelopment.Click
        ' This button is the third among which the user may click on to reveal a term
        ' This code is executed when the user clicks on the first button.
        ' When it is executed the definition of only "Rapid Application Development"
        ' will be revealed, while the other two remain hidden.
        ' Once the user clicks any of the other two buttons
        ' This definition will disappear, and only the requested
        ' definition shall be displayed.

        lblComputerHardware.Visible = False
        lblDeveloper.Visible = False
        lblRapidApplicationDevelopment.Visible = True
        btnRapidApplicationDevelopment.Enabled = True

    End Sub


    Private Sub btnExitWindow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExitWindow.Click
        ' Upon a user click the subsequent program will termninate regardless or state or input

        Close()


    End Sub
End Class
« Last Edit: August 08, 2014, 01:46:04 pm by JRcade19 »