Mainly for shits and giggles, how [url="http://facepunch.com/showthread.php?t=1414018&p=45588346&viewfull=1#post45588346"]does one do this[/url]?
I've got off to this cute start:
[code]#include <iostream>
#include <windows.h>
// Use c++ helloworld.cpp -o helloworld.exe -lgdi32
int main()
{
SetPixel(NULL, 10, 10, RGB(255, 0, 0));
}[/code]
I just started seeing how I can play with that
But I mean it looks like he's got it rendering in the command prompt window. If I'm wrong with that assumption I can wrangle through the rest with setting a window, but that really piqued my interest (if it is indeed in cmd)
[QUOTE=NiandraLades;46002162]I know lua quite well and enjoy working with it, but I have no experience with any other language or programming at all before hand before I started. If I wanted to try out a new language or do something different, would it be best to become more confident with lua or just go for it now?
If so, what would you recommend? Thanks![/QUOTE]
Since you've done Lua you have an option to jump to a similar language and learn a few new concepts. This should probably feel pretty satisfying since you'll be able to grasp it easily.
On the other hand, you can throw out everything you know and try something from the opposite end of the spectrum. With F# you would learn functional and object-oriented programming, and learn a very practical language that can use .NET. You'll have to google around for some tutorials since I haven't used any so I don't know what to recommend.
With Haskell you would learn pure functional programming. Haskell is more elegant but more strict. [url]http://learnyouahaskell.com/[/url] is one of the best tutorials on anything I've ever read.
Others have recommended some other languages that intersect with Lua more so they should be easier to pick up.
[QUOTE=frdrckk;46008678]I see, thanks!
I asked because the book I'm reading uses int main(void) but in class we usually just use int main() and yet the program runs just fine if I use either one.[/QUOTE]
Are you using the Complete C reference, 4th edition by any chance? That's what I have. I think it's better to use int main() because it's compatible with c++, though don't quote me on that, since I'm only a freshman
Nope, currently reading C: How to program 6th edition for class and C Primer Plus 6th edition as a self study book.
Does anybody here have a recommendation for a good source for learning assembly language? I'm taking a class right now but the prof is impossible to understand, and the textbook is sort of useless.
Is there an easy way to convert a huge hex dump's values into ascii?
[editline]18th September 2014[/editline]
[QUOTE=EMMERS!;46012615]Does anybody here have a recommendation for a good source for learning assembly language? I'm taking a class right now but the prof is impossible to understand, and the textbook is sort of useless.[/QUOTE]
I am currently fighting with the LC3 simulator in our class. Using this book, [url]http://www.amazon.com/Introduction-Computing-Systems-gates-beyond/dp/0072467509[/url]
The struggle is real.
So I got my first assignment for my programming class, and the thing is a joke. Its taken the teacher 2 weeks to explain how to use the printf function in C, and so now for the work we have to do is stupid. We have to use the console window to print our name in this format using only printf... Its almost as if the teacher doesnt know that whitespace has a different size than normal characters, so you might have everything looking find and dandy in the code, but once compiled to the console window its all fucked up.
[code]#include "stdio.h"//Import input and output functions
int main()//First function called
{
printf(" MM MM A CCCCCCC KK K \n");
printf(" MMM MMM A A CC KK K \n");
printf(" MM M MM A A CC KKK \n");
printf(" MM MM AAAAAAA CC KK K \n");
printf(" MM MM A A CCCCCCC KK K \n");
getchar();//Waits for user input to close the console
}
[/code]
[t]http://i.imgur.com/7mMNuSt.png[/t]
this is how I have to write it to get it to look normal.
[t]http://i.imgur.com/iD1LWjp.png[/t]
[t]http://i.imgur.com/V9i0ch0.png[/t]
[QUOTE=Shirky;46013208]So I got my first assignment for my programming class, and the thing is a joke. Its taken the teacher 2 weeks to explain how to use the printf function in C, and so now for the work we have to do is stupid. We have to use the console window to print our name in this format using only printf... Its almost as if the teacher doesnt know that whitespace has a different size than normal characters, so you might have everything looking find and dandy in the code, but once compiled to the console window its all fucked up.
[code]#include "stdio.h"//Import input and output functions
int main()//First function called
{
printf(" MM MM A CCCCCCC KK K \n");
printf(" MMM MMM A A CC KK K \n");
printf(" MM M MM A A CC KKK \n");
printf(" MM MM AAAAAAA CC KK K \n");
printf(" MM MM A A CCCCCCC KK K \n");
getchar();//Waits for user input to close the console
}
[/code]
[t]http://i.imgur.com/7mMNuSt.png[/t]
this is how I have to write it to get it to look normal.
[t]http://i.imgur.com/iD1LWjp.png[/t]
[t]http://i.imgur.com/V9i0ch0.png[/t][/QUOTE]
Why aren't you using a monospaced font?
This is what I have to use with the course.
[QUOTE=EmilioGB;46009860]Wrong result. C#. I want to execute : a * h / 2[/QUOTE]
That should be (a * h) / 2, then.
[QUOTE=DrTaxi;46014314]That should be (a * h) / 2, then.[/QUOTE]
Im using decimals, not ints. It just displays 0.
a = decimal
h = decimal
[code]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
decimal aTriangle = 5, hTriangle = 3, tResult;
tResult = (aTriangle * hTriangle) / 2;
Console.WriteLine(tResult);
Console.ReadKey();
}
}
}
[/code]
outputs 7.5.
The user is defining the variables. He's got a numeric up-down that has a increment of 0,5.
Okay, so i've got this :
[IMG]http://snag.gy/rXxP5.jpg[/IMG]
And when i add some, and click "calculate" i got this :
[IMG]http://snag.gy/WKfIJ.jpg[/IMG]
The whole code is this :
[CODE]using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void calcRect_Click(object sender, EventArgs e)
{
decimal aRectangle;
decimal bRectangle;
decimal rResult;
aRectangle = aNumRect.Value;
bRectangle = bNumRect.Value;
rResult = aRectangle * bRectangle;
rRectangle.Text = rResult.ToString();
}
private void calcTriangle_Click(object sender, EventArgs e)
{
decimal aTriangle, hTriangle, tResult;
aTriangle = aNumRect.Value;
hTriangle = bNumRect.Value;
tResult = (aTriangle * hTriangle) / 2;
rTriangle.Text = tResult.ToString();
}
}
}
[/CODE]
[code]
aTriangle = aNumRect.Value;
hTriangle = bNumRect.Value;[/code]
You're using the wrong controls.
It happens to all of us.
[QUOTE=CanadianBill;46010682]Mainly for shits and giggles, how [url="http://facepunch.com/showthread.php?t=1414018&p=45588346&viewfull=1#post45588346"]does one do this[/url]?
I've got off to this cute start:
[code]#include <iostream>
#include <windows.h>
// Use c++ helloworld.cpp -o helloworld.exe -lgdi32
int main()
{
SetPixel(NULL, 10, 10, RGB(255, 0, 0));
}[/code]
I just started seeing how I can play with that
But I mean it looks like he's got it rendering in the command prompt window. If I'm wrong with that assumption I can wrangle through the rest with setting a window, but that really piqued my interest (if it is indeed in cmd)[/QUOTE]
You need to get the device context of the console window (look up GetConsoleWindow and GetDC), and pass it to SetPixel in order to draw to the console.
[QUOTE=DrTaxi;46015159][code]
aTriangle = aNumRect.Value;
hTriangle = bNumRect.Value;[/code]
You're using the wrong controls.
It happens to all of us.[/QUOTE]
Thanks man. I appreciate that.
Hey, I am thinking of making a mobile app (hopefully multi-platform in the end but for now I am good with making it either for Android or IOS) which requires some augmented reality style tracking of a specific image. In the end I want to know the position and corners of the tracked image to superimpose another image on top of it. Is there any free or open libraries to accomplish such a thing?
I know there is OpenCV which is completely free.
I also found a library by Qualcomm called Vuforia. It looks like its free to use but they sell some kind of cloud service so I am not sure if it is completely free.
Any suggestions or bits of knowledge?
Is there any way to get MFC as standalone or something? I don't want to download and install VS 2010 Ultimate just to get those goddamn header files.
[QUOTE=Shirky;46014252]This is what I have to use with the course.[/QUOTE]
Uh, what? Code editors should really have a monospaced font, I don't see why your course would say otherwise?
Shirky's teacher appears to be a moron.
If I was to get into game design, what would anybody advise to do and to not to do. (Apart from don't do it lol) I'm currently learning Python, best in class by a mile, and I know GLua enough to get most things done. Is there anything I should check out that might help me make a choice etc? Thanks.
I need some ideas for projects that enable me to learn a lot about a topic (e.g. 2d lighting/rendering/etc). I want something to work on every day and progressively make it better/make it function. I would rather work with Java (as I don't have VS 2014 on this machine) but I also know C++.
[QUOTE=NixNax123;46026459]I need some ideas for projects that enable me to learn a lot about a topic (e.g. 2d lighting/rendering/etc). I want something to work on every day and progressively make it better/make it function. I would rather work with Java (as I don't have VS 2014 on this machine) but I also know C++.[/QUOTE]
BASIC interpreter
[QUOTE=proboardslol;46031762]BASIC interpreter[/QUOTE]If I knew BASIC, I would try that, because it sounds fun. But I think not knowing BASIC would be a hell of an obstacle.
[editline]20th September 2014[/editline]
But I really like the idea of big projects like that, anyone else?
[QUOTE=NixNax123;46032111]If I knew BASIC, I would try that, because it sounds fun. But I think not knowing BASIC would be a hell of an obstacle.
[editline]20th September 2014[/editline]
But I really like the idea of big projects like that, anyone else?[/QUOTE]
Took me a couple months to learn BASIC. If you want something small, try microsoft's SmallBASIC or [url=http://www.petitcomputer.com/]Petit Computer's SmileBASIC[/url]
-snip-
[QUOTE=NixNax123;46032850]I don't have a couple of months (or a nintendo ds) to focus on just learning basic for the sole purpose of making an interpreter, do you have any other projects I can do other than making an interpreter?[/QUOTE]
Dunno; that's what I wanna do
[quote]any other projects I can do other than making an interpreter?[/quote]
Anyone? I want something to work on every day, I need practice.
[QUOTE=NixNax123;46035985]Anyone? I want something to work on every day, I need practice.[/QUOTE]
Make a computer opponent for a simple board game, like battle ship, or connect 4 or clue, or make an obscure board game into a digital version.
write an efficient collision engine for 2D or 3D that handles fast moving objects.
[QUOTE=Fantym420;46036543]Make a computer opponent for a simple board game, like battle ship, or connect 4 or clue, or make an obscure board game into a digital version.
write an efficient collision engine for 2D or 3D that handles fast moving objects.[/QUOTE]
I think I might try making connect 4 with SP mode with a simple AI/MP mode! Thanks!
Sorry, you need to Log In to post a reply to this thread.