C.
You still recommend to learn C though, or at least learn C first?
For example: Sounds like you might be better off using shell scripting Greaver.
But then I hear .bat files can be a cunt. BASH ftw. Again I'd probably use Python, if I knew it.
Again I'd probably use Python, if I knew it.You should try Python. I learned how to program in Python when I made my own Mount&Blade mod. It was really, really easy.
Realistically you could stay with C# since the largest proportion of programmer jobs are C#Bell is right. C# will get you a job.
Hmms Problems has convinced me to learn c# since it seems to be most popular, and Python seems to need other programming languages to work well.
TBH, I actually want to learn alot of programming languages, including Java, Lua and now, Python.
if you can pick up c or c++ as a first language, you can dominate the world.
Yeah Pyro, I worked out that IDLE is really a "Shell" (I don't know what the term means yet)
Turns out I had to go "New" to get to what I wanted.
I know... I know... "Herp Derp."
You should totally learn punch card programming, it's totally in demand right now. You can get 150k+ for punch card programming.First one to make a working version of Crysis wins
just starting the first planing of a online 3d rpg game with a friend.
TBH my goal is to make a 3d fps
Mod an existing FPS into the game you want.Two of the groups in game development used a program called "FPS Creator" to make their games.
Design your own first person shooter games
No coding required!
Create your game instantly with the intuitive 3D editor. Drag and drop walls, lights, doors, enemies, ammo, weapons and more - with pixel perfect precision, and watch as they intelligently link together. Then with one click of the mouse, play your game!
Quote from: Problems;1333781just starting the first planing of a online 3d rpg game with a friend.
Every beginner game dev hobbyist has the dream of making an online 3rd RPG game.
They are one of the hardest and most content filled games imaginable and therefore generally a terrible idea to attempt.
Even a Offline 2D RPG is a shit ton of work, because the game is all about content and not so much about game mechanics.
if you can pick up c or c++ as a first language, you can dominate the world.
Mod an existing FPS into the game you want.
The outer casing?
A hollow casing?
A defensive layer?
I'm guessing the main word would be casing?
He could learn LUA. He is a gmod admin after all.
Don't be too harsh, everyone starts somewhere.
Quote from: Problems;1333781just starting the first planing of a online 3d rpg game with a friend.
Every beginner game dev hobbyist has the dream of making an online 3rd RPG game.
They are one of the hardest and most content filled games imaginable and therefore generally a terrible idea to attempt.
Even a Offline 2D RPG is a shit ton of work, because the game is all about content and not so much about game mechanics.
That's why I'm doing it with a friend, who has experience:P
It's not an issue of experience, more of time and manpower.Woah! Hold up there!
You realise there are entire game studios who won't touch RPG's due to their scope.
What is your scope?
Are you making it to learn or do you actually want people to play it?
Hmms Problems has convinced me to learn c# since it seems to be most popular, and Python seems to need other programming languages to work well.
TBH, I actually want to learn alot of programming languages, including Java, Lua and now, Python.
Bell, more of an experience...but graphics will be like runescape so I can make textures my self, and I know a modeler who is willing to help. Morly so just doing all the coding side of things with a small level.
By the way, Glua is a bitch to debug, Gmod kept telling me wrong lines of code that were wrong. :!
With the help of Problems, I am now downloading a legit version of Visual Studio 2010 >.<
Still keen to give Python a go but haven't had much time today lol
Drinking a beer makes you program better.(http://imgs.xkcd.com/comics/ballmer_peak.png)
Drinking a beer makes you program better.
Drinking two makes it worse.
make it display something in the text box when you hit the button (textbox.text = "blah")
Quote from: toofast;1334448make it display something in the text box when you hit the button (textbox.text = "blah")
Bullshit.
Everyone knows the text MUST be "Hello world."
These are the rules.
I'm not quite sure how to make the numbers work i.e, if you press 8, Then press 3, I have no idea how to make it change from 8 to 83...Unless I times 8 by 10... oooobrb
x = x * 10 + 1;
label1.Text = x;
Quote from: Pyromanik;1334460Quote from: toofast;1334448make it display something in the text box when you hit the button (textbox.text = "blah")
Bullshit.
Everyone knows the text MUST be "Hello world."
These are the rules.
Those be the rules in the console. The only rule for text boxes is there are no rules. They be wild.
Dang, this programming shit sounds interesting. The most experience I have with it though is source engine scripting. I'm also interested in modelling. I'm really not sure what type of brain I am that would make me better for one or the other. Being able to make game characters do certain stuff sounds cool to me, but making a gun or a model doesn't sounds to bad either.
Well, I've gotten pretty good at scripting if that's any help, and I find getting it all to work together enjoyable. I have now gone over the top and use a fast setting change and weapon use script for every character in TF2.
And then there's website design, which doesn't sounds too bad either.
Dang, what to do?
I can no longer set a label's caption to a number, wtfwtfwtfwtf
Might just wait for Problems.
I've set a interger variable with int x, z;
and i'm trying to edit the x value everytime a button is pressed, This is the coding I wrote for the number 1 button.Code: [Select]x = x * 10 + 1;
label1.Text = x;
It doesn't seem to like the fact that I want to "implicity convert type 'int' to 'string'"
Why nottttttttttttttttttttttttttttttttttttttttttttt
Don't you mean sprintf(). atoi() is string to int.
But yea, thats why i like c#. It has a lot of decent methods already set up, to do some of the more tricky stuff, so you don't need to waste time writing all of the low level things.
Quote from: toofast;1334534Don't you mean sprintf(). atoi() is string to int.
But yea, thats why i like c#. It has a lot of decent methods already set up, to do some of the more tricky stuff, so you don't need to waste time writing all of the low level things.
char* to int ;D
and yes, I know.
And no, I didn't mean sprintf, I meant itoa()
You can use a dirty way to do this in Java by simply adding the number to an empty string. Probably shouldnt do this though.Code: [Select]x = x * 10 + 1;
label1.Text = x;
x=x*10+1;
label1.setText(""+x);
If you have access to dreamspark, see if you can get a XNA Creators Club Academic Membership, then you can run your games on your xbox 360.I thought you needed two licenses for xbox 360 development?
However, if you don't have an xbox, then it wouldn't be much use.
I find string.format really useful
string someWords = string.format("Words and shit {0} {1}", x , y);
{0} and {1} are replace by x and y respectively. Where x/y can be a number or a string.
int x = x * 10 + 1;
Well how can x = x when x doesn't exist yet?
What is x * 10 when x is undefined?
Does not compute :p
If you want to do floating point calculations (12.7 + 29.45 etc), it would be best to use a double
[url]http://msdn.microsoft.com/en-us/library/9ahet949.aspx[/url]
cough cough...first program in C#....cough...
I don't like the fact that it installs, I would of rather it just run off a exe, But I have no clue on how to fix that atm.
Also sorry about the name, I stamped the name calculator inside the program all over the place, but it still wants to be windows application form 2. sigh.
Make sure to remove it via add or remove programs after you've played around with your awesom-o calculator.
Now replace all of your instances of int with double and stuff like 1/100 won't equal 0 ;)
Good job tho.
Go into to bin/debug (or release), it will be there as an exe.
Quote from: Spacemonkey;1334785Go into to bin/debug (or release), it will be there as an exe.
All I did was "release "Calculator"". I also can't find what your talking about, the files in the rar are all the files I could get out of it lol. No exe's :x
cough cough...first program in C#....cough...
I don't like the fact that it installs, I would of rather it just run off a exe, But I have no clue on how to fix that atm.
Also sorry about the name, I stamped the name calculator inside the program all over the place, but it still wants to be windows application form 2. sigh.
Make sure to remove it via add or remove programs after you've played around with your awesom-o calculator.
Yep, they are the ones.
I ran it, used it to calculate my taxes, I owe 0 dollars, good job :D
You can download Visual Studio Express in your language of choice here.
[url]http://www.microsoft.com/express/Downloads/[/url]
If you want to start really easy, you can start with small basic
[url]http://smallbasic.com/[/url]
I'm not sure what you need for game modding.
I'm not Gmod modding. No.
A few open games use Python, like Mount & Blade, I'm interested in that. What's the Source engine use?
Remember, this is just modding a game into my own, nothing more.
I find string.format really useful
string someWords = string.format("Words and shit {0} {1}", x , y);
{0} and {1} are replace by x and y respectively. Where x/y can be a number or a string.
Ok, so I'm going to give programming go. However, I don't know where the place for me to start is.
I'm interested in game modding, for other people or me. This will probably always be a hobby. What should I start learning and how?
Hmmm. C++.
Most require you to know a real language.
A few open games use Python, like Mount & Blade, I'm interested in that.Mount&Blade is my python programming passion.
tiwa, putting a title on each of your posts is really annoying, shows differently on the main page then i end up back in threads i dont care about
not sure if anyone else gets annoyed by this
/rant
O| |X
-----
|O|
-----
X| |X
O X
O
X X
^ depends. On a number of things, most of all the toolkit being used.
If it's Qt, use Qt designer, it comes with the Qt package.
kk, I'm still quite confused over how I'm meant to use arrays. I could easily do this with if statements, but when I try put arrays into the equation.. I just can't work it out!
I have no idea what i'm meant to be making into an array. The possible wins? Each squares possibility? Or just the outcome of the board?
[p] [c] [b] [t] [a]
[s]
[p]
Quote from: Pyromanik;1335414^ depends. On a number of things, most of all the toolkit being used.
If it's Qt, use Qt designer, it comes with the Qt package.
Glade for GTK apparently.
I got bored, and also suffer from insomnia ;-) So I made a sample solution. two reasons for not giving code 1) I don't want to give the answers away 2) The code is terriblly hacky, everything is static, the code is pretty much the quickest solution I made to work
Quote from: Pyromanik;1335451Quote from: Pyromanik;1335414^ depends. On a number of things, most of all the toolkit being used.
If it's Qt, use Qt designer, it comes with the Qt package.
Glade for GTK apparently.
Cheers for that, it does sound like gtk. I will have a look today.
Array's should only hold a number of "items" in one dimension.
Being restricted to 1-D arrays isn't that bad.
Yeah in C# you can do int[,], or an array of arrays.Yea the first way, just seems un-natural especially if you start programming with the likes of C, where such data structures seem (as said before) redundant. There is effectively no difference in creating a 2D array of int[,] or int[][], just the interaction is slightly different.
imo either way is fine, just whatever suits your style.
Well some languages just don't give you the syntax to make multi-dimensional arrays.Yea it seemed kind of weird when I threw together that app, I used an array of arrays of ints, and had issues because I had to initialise them. So I gave in and used their stupid multi-D syntax
It's impossible to 'restrict' someone from making multi-d arrays because you can just implement them yourself by creating list of lists.
So when I say restricted to 1D array I really mean syntaxicly restricted.
string cubbyholdbox[1000]
for int i = 0; i < 1000; ++i do
cubbyholdbox[i] = new string()
end
It wouldnt be fun typing out.But arn't you just as equally typing out
string cubbyholebox1 all the way to
string cubbyholebox1000 now would it.
string cubbyholdbox[500]
for int i = 0; i < 500; ++i do
cubbyholdbox[i] = new string()
end
for every instance of i between 0 and 500, create array segment (or whatever its termed) for that value of i, then add 1 to i and repeat
int loop_size = 500
int current = 0
while current < loop_size do
cubbyholdbox[current] = new string()
current = current + 1
end
int i;
char[20] myArray;
for(i = 0; i < 20; i = (i + 2)) {
myArray[i] = 'a';
}
[a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ]
my pseudo code here is some weird mix between C and lua :p
Just got home from work experience.
I understand what you all have explained, But I don't understand why you would need to, apart from doing something to the whole array of items at once. Why not just make...
string cubbyholebox1;
string cubbyholebox2;
string cubbyholebox3;
if user says so and so, cubbyhole1= shoes
I'm just confused by how its different. It kinda just seems tidier D:
I thought of another use, which really might only apply to gmod, which could add a new line in the array each time it finds a specific object.
Quote from: toofast;1335471Cheers for that, it does sound like gtk. I will have a look today.
GTK is C, not C++.
//the menu:
m_refActionGroup = Gtk::ActionGroup::create();
//file menu:
m_refActionGroup->add(Gtk::Action::create("FileMenu", "File"));
m_refActionGroup->add(Gtk::Action::create("FileQuit", Gtk::Stock::QUIT), sigc::mem_fun(*this, &Gui::on_quit));
//view menu
m_refActionGroup->add(Gtk::Action::create("ViewMenu", "View"));
m_refActionGroup->add(Gtk::Action::create("ShowGraphs", "Graphs"), sigc::mem_fun(&graphs_window, &GraphsWindow::Show));
m_refActionGroup->add(Gtk::Action::create("ShowGPS", "GPS Plot"), sigc::mem_fun(&gpswindow, &GPSWindow::Show));
m_refActionGroup->add(Gtk::Action::create("Options", "Program Options"), sigc::mem_fun(¶meterswindow, &ParametersWindow::Show));
m_refActionGroup->add(Gtk::Action::create("StageWindow", "Create Stage Window"), sigc::mem_fun(*this, &Gui::on_create_laser_display));
//datalogging menu:
m_refActionGroup->add(Gtk::Action::create("LogMenu", "Logging"));
m_reflog_data = Gtk::ToggleAction::create("EnableLog", "Log Data?");
m_reflog_data->set_active(true);
m_refActionGroup->add(m_reflog_data, sigc::mem_fun(*this, &Gui::on_log_data_clicked));
m_refstart_new_log = Gtk::Action::create("RestartLog", "Start New Logfile");
m_refActionGroup->add(m_refstart_new_log, sigc::mem_fun(*this, &Gui::on_log_data_clicked));
//help menu:
m_refActionGroup->add(Gtk::Action::create("HelpMenu", "Help") );
m_refActionGroup->add(Gtk::Action::create("HelpAbout", Gtk::Stock::HELP), sigc::mem_fun(*this, &Gui::on_help) );
m_refUIManager = Gtk::UIManager::create();
TextBox::TextBox(string name) : m_clearbutton("Clear") {
set_label(name);
set_size_request(270,1);
add(m_box);
m_box.pack_start(m_scrolledwindow);
m_box.pack_start(m_clearbox, PACK_SHRINK);
m_clearbox.pack_start(m_clearbutton, PACK_SHRINK);
m_clearbutton.signal_clicked().connect(sigc::mem_fun(*this, &TextBox::on_clearbutton));
//only show the scrollbars when they are necessary:
m_scrolledwindow.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC);
m_textview.set_editable(false);
m_scrolledwindow.add(m_textview);
m_reftextbuffer = TextBuffer::create();
m_textview.set_buffer(m_reftextbuffer);
//for scrolling to the bottom:
m_mark = m_reftextbuffer->create_mark(m_reftextbuffer->end(), false);
}
void TextBox::AddText(string const& text) {
m_reftextbuffer->insert(m_reftextbuffer->end(), text);
m_textview.scroll_to(m_mark);
}
void TextBox::on_clearbutton() {
m_reftextbuffer->set_text("");
}
#DEFINE white 0xFFFFFF
#DEFINE red 0xFF0000
#DEFINE green 0x00FFF0
#DEFINE blue 0x0000FF
icon[1],[1] = white; icon[2][1] = white ; icon[3][1] = white ; icon[4][1] = white ; icon[5][1] = white ; icon[6][1] = white ; icon[7][1] = white ; icon[8][1] = white ; icon[9][1] = white ; icon[10][1] = white ; icon[11][1] = white ; icon[12][1] = white ; icon[13][1] = white ; icon[14][1] = white ; icon[15][1] = white ; icon[16][1] = white ;
icon[2][2] = red ; icon[3][2] = red ; icon[4][2] = white ; icon[5][2] = white ; icon[6][2] = white ; icon[7][2] = white ; icon[8][2] = white ; icon[9][2] = white ; icon[10][2] = white ; icon[11][2] = white ; icon[12][2] = white ; icon[13][2] = white ; icon[14][2] = white ; icon[15][2] = white ; icon[16][2] = white ;
icon[2][3] = red ; icon[3][3] = red ; icon[4][3] = white ; icon[5][3] = white ; icon[6][3] = white ; icon[7][3] = white ; icon[8][3] = white ; icon[9][3] = white ; icon[10][3] = white ; icon[11][3] = white ; icon[12][3] = white ; icon[13][3] = white ; icon[14][3] = white ; icon[15][3] = white ; icon[16][3] = white ;
icon[2][4] = white ; icon[3][4] = white ; icon[4][4] = green ; icon[5][4] = green ; icon[6][4] = white ; icon[7][4] = white ; icon[8][4] = white ; icon[9][4] = white ; icon[10][4] = white ; icon[11][4] = white ; icon[12][4] = white ; icon[13][4] = white ; icon[14][4] = white ; icon[15][4] = white ; icon[16][4] = white ;
icon[2][5] = white ; icon[3][5] = white ; icon[4][5] = green ; icon[5][5] = green ; icon[6][5] = white ; icon[7][5] = white ; icon[8][5] = white ; icon[9][5] = white ; icon[10][5] = white ; icon[11][5] = white ; icon[12][5] = white ; icon[13][5] = white ; icon[14][5] = white ; icon[15][5] = white ; icon[16][5] = white ;
icon[2][6] = white ; icon[3][6] = white ; icon[4][6] = white ; icon[5][6] = white ; icon[6][6] = blue ; icon[7][6] = blue ; icon[8][6] = white ; icon[9][6] = white ; icon[10][6] = white ; icon[11][6] = white ; icon[12][6] = white ; icon[13][6] = white ; icon[14][6] = white ; icon[15][6] = white ; icon[16][6] = white ;
icon[2][7] = white ; icon[3][7] = white ; icon[4][7] = white ; icon[5][7] = white ; icon[6][7] = blue ; icon[7][7] = blue ; icon[8][7] = white ; icon[9][7] = white ; icon[10][7] = white ; icon[11][7] = white ; icon[12][7] = white ; icon[13][7] = white ; icon[14][7] = white ; icon[15][7] = white ; icon[16][7] = white ;
icon[2][8] = white ; icon[3][8] = white ; icon[4][8] = white ; icon[5][8] = white ; icon[6][8] = white ; icon[7][8] = white ; icon[8][8] = white ; icon[9][8] = white ; icon[10][8] = white ; icon[11][8] = white ; icon[12][8] = white ; icon[13][8] = white ; icon[14][8] = white ; icon[15][8] = white ; icon[16][8] = white ;
icon[2][9] = white ; icon[3][9] = white ; icon[4][9] = white ; icon[5][9] = white ; icon[6][9] = white ; icon[7][9] = white ; icon[8][9] = white ; icon[9][9] = white ; icon[10][9] = white ; icon[11][9] = white ; icon[12][9] = white ; icon[13][9] = white ; icon[14][9] = white ; icon[15][9] = white ; icon[16][9] = white ;
icon[2][10] = white ; icon[3][10] = white ; icon[4][10] = white ; icon[5][10] = white ; icon[6][10] = white ; icon[7][10] = white ; icon[8][10] = white ; icon[9][10] = white ; icon[10][10] = white ; icon[11][10] = white ; icon[12][10] = white ; icon[13][10] = white ; icon[14][10] = white ; icon[15][10] = white ; icon[16][10] = white ;
icon[2][11] = white ; icon[3][11] = white ; icon[4][11] = white ; icon[5][11] = white ; icon[6][11] = white ; icon[7][11] = white ; icon[8][11] = white ; icon[9][11] = white ; icon[10][11] = white ; icon[11][11] = white ; icon[12][11] = white ; icon[13][11] = white ; icon[14][11] = white ; icon[15][11] = white ; icon[16][11] = white ;
icon[2][12] = white ; icon[3][12] = white ; icon[4][12] = white ; icon[5][12] = white ; icon[6][12] = white ; icon[7][12] = white ; icon[8][12] = white ; icon[9][12] = white ; icon[10][12] = white ; icon[11][12] = white ; icon[12][12] = white ; icon[13][12] = white ; icon[14][12] = white ; icon[15][12] = white ; icon[16][12] = white ;
icon[2][13] = white ; icon[3][13] = white ; icon[4][13] = white ; icon[5][13] = white ; icon[6][13] = white ; icon[7][13] = white ; icon[8][13] = white ; icon[9][13] = white ; icon[10][13] = white ; icon[11][13] = white ; icon[12][13] = white ; icon[13][13] = white ; icon[14][13] = white ; icon[15][13] = white ; icon[16][13] = white ;
icon[2][14] = white ; icon[3][14] = white ; icon[4][14] = white ; icon[5][14] = white ; icon[6][14] = white ; icon[7][14] = white ; icon[8][14] = white ; icon[9][14] = white ; icon[10][14] = white ; icon[11][14] = white ; icon[12][14] = white ; icon[13][14] = white ; icon[14][14] = white ; icon[15][14] = white ; icon[16][14] = white ;
icon[2][15] = white ; icon[3][15] = white ; icon[4][15] = white ; icon[5][15] = white ; icon[6][15] = white ; icon[7][15] = white ; icon[8][15] = white ; icon[9][15] = white ; icon[10][15] = white ; icon[11][15] = white ; icon[12][15] = white ; icon[13][15] = white ; icon[14][15] = white ; icon[15][15] = white ; icon[16][15] = white ;
icon[2][16] = white ; icon[3][16] = white ; icon[4][16] = white ; icon[5][16] = white ; icon[6][16] = white ; icon[7][16] = white ; icon[8][16] = white ; icon[9][16] = white ; icon[10][16] = white ; icon[11][16] = white ; icon[12][16] = white ; icon[13][16] = white ; icon[14][16] = white ; icon[15][16] = white ; icon[16][16] = white ;
for (int x=1, int y=1, x<8, y<8, x++, y++)
{
print(x,y)
return 0;
}
You should be able to do both (2p & ai) really easy Kayne.
FUCK YOU MULTI DIMENSIONAL ARRAYS.
Five dimensional arrays are your friend
JPanel[]squares=new JPanel[9];
for(int i=0;i<squares.length;i++){
squares[i]=new JPanel();
}
Normally I would EXTEND the JPanel to hold a custom picture and call the JPanel's "GamePanel". That way you can use them to hold the player as well so when you check through the played tiles you just need to do a simpley for loop thingy.FUCK YOU MULTI DIMENSIONAL ARRAYS.
board[horizontal-index][vertical-index]
Hopefully that helps you visualise it in your head :)Quote from: `Kayne;1335762FUCK YOU MULTI DIMENSIONAL ARRAYS.Quote from: Tiwaking!;1333600Five dimensional arrays are your friend
I'll give you some help with the tic tac toe thing, not alot of help since it is in java.Code: [Select]JPanel[]squares=new JPanel[9];
Normally I would EXTEND the JPanel to hold a custom picture and call the JPanel's "GamePanel". That way you can use them to hold the player as well so when you check through the played tiles you just need to do a simpley for loop thingy.
for(int i=0;i<squares.length;i++){
squares[i]=new JPanel();
}
Tic tac toe is hard to write, despite what the huge nerds say in this thread. You can give this a go. It was an old alpha version of my flat mates "Keith n Crosses" game so it has alot of bugs the finished version does not.
See if you can figure out how it was made.
[url]http://tiwaking.hostzi.com/keithncrosses/index.html[/url]
Also, how is the game strange?
Whooooosh, over and gone for six!Quote from: Xenolightning;1335680Also, how is the game strange?lol, it was a quote from Wargames, awesome movie.
public class Variables
{
public static string[, , ,] Easy; {{"E","A","S","Y"},{"e","a","s","y"}}
}
[E] [A] [S] [Y]
[e] [a] [s] [y]
{
public static string[, , ,] Easy = { {E,A,S,Y},{e,a,s,y} };
}
Code: [Select]public class Variables
{
public static string[, , ,] Easy; {{"E","A","S","Y"},{"e","a","s","y"}}
}
JPanel sounds awfully non-console...JPanel is a good example since you can put an array on it, so if you want to put, say, 'power-ups' on the squares which are random you can have it calculate that all for you.
And that's a single dimension array!
public class BoardRow extends JPanel{
JPanel[]lines=new JPanel[3];
}//class
Then have:public class Board extends JPanel{
BoardRow[]rows=new BoardRow[3];
}//class
This way you can keep all the relevant code for working out stuff in the Board and BoardRows.Noughts and crosses isn't hard to write. It's more about having the commitment to see it through.Commitment is the last refuge of the learner and the first stop for huge nerds.
I can't see how to make the player win.. If i'm going to make a bot I want it to never lose lol
Quote from: `Kayne;1336005
I can't see how to make the player win.. If i'm going to make a bot I want it to never lose lol
Um, you know it's Tic-Tac-Toe right?
It always ends in a draw, unless one player does a stupid mistake.
Just do a string.ToLowerCase();
Then match the result of that.
string name = "SpAcEMONkey";
string lowerCaseName = name.ToLowerCase();
where an inbuilt switch for case insensitive comparison doesn't exist I'd use a regex, but that's because I'm a huge nerd apparently.
public void Greetings()
{
Console.WriteLine();
Console.ReadLine();
if (Console.ReadLine() == "Hey")
Greeting = "Hey";
}
int so = 2;
switch (so)
{
case 1 :
mode = 1;
break;
case 2 :
mode = 2;
break;
default :
Console.WriteLine ("");
break;
}
I'm keen for this next challenge, depending on what it is.The next challenge is:
Yay Kayne, it's good to see the youth of today actually trying do something with themselves.
btw again, Spacemonkey, it seems that if a chess piece kills more than 3 people, then it will blood3 will be dropped when it kills more?
ahh, that's going to be a bit hard.
My code is very messy, as well as specific.
([url]http://i3.photobucket.com/albums/y67/jarik/chess.png[/url])
Quote from: `Kayne;1336902ahh, that's going to be a bit hard.
My code is very messy, as well as specific.
That's the point ;D
I'll help you out. It'll be great. You'll learn heaps, and your next program will be easier to achieve! :)
For a start:
Dear Kayne, please write more functions.
namespace WindowsFormsApplication1
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
public void method1(int input1, string input2)
{
//Do crap
}
}
}
HAI
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++
..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
DO ,1 <- #13
PLEASE DO ,1 SUB #1 <- #238
DO ,1 SUB #2 <- #108
DO ,1 SUB #3 <- #112
DO ,1 SUB #4 <- #0
DO ,1 SUB #5 <- #64
DO ,1 SUB #6 <- #194
DO ,1 SUB #7 <- #48
PLEASE DO ,1 SUB #8 <- #22
DO ,1 SUB #9 <- #248
DO ,1 SUB #10 <- #168
DO ,1 SUB #11 <- #24
DO ,1 SUB #12 <- #16
DO ,1 SUB #13 <- #162
PLEASE READ OUT ,1
PLEASE GIVE UP
mmm yeah. A function cannot be inside another function.
Unless you're batshit crazy like javascript.
Quote from: Pyromanik;1337198mmm yeah. A function cannot be inside another function.
Unless you're batshit crazy like javascript.
or you use lambda expressions/statements in c#
not true functions.
Lambda expressions are great. Linq is orsome, I use it all the time now, so useful.[End of diatribe. We now return you to your regularly scheduled
Quote from: Pyromanik;1337439not true functions.
yes they are, you need to check your definition of a function.
I know a little actionscript.As a side note: Javascript has now caught up to Java in terms of speed for certain commands.
Enough to know that I wouldn't waste any more time on anything flash.
It's based on javascript I think, learn that, much more useful in terms of future commercial use.
You should only need the basics for flash comics either way :D
and @Tiwa, Flash is being obsoleted now?
It seems as alive as it's always been, Explain please? :P
Must be different in your language.
Lambda forms can be used wherever function objects are required. They are syntactically restricted to a single expression.
[url]http://docs.python.org/py3k/tutorial/controlflow.html#lambda-forms[/url]
Though technically you are correct I guess, semantically they're the same.
Python is also batshit crazy, allowing nested functions :/
I guess most high level scripting languages do.
Quote from: Tiwaking!;1336788The next challenge is:Challenge accepted.
GetSomeChess
Pieces have must have customisable icons. This way you can make the different pieces to be the avatars of people from the forums.
Movement rules are not too important at the moment.
It will download your avatar from GetSomeforums, based on your profile ID. Now I have to get that chess part working.
The basics is all I'm really wanting to learn. For now, Atleast.
Although I do / did plan on making some srs-buisness flash games with 2d water physics etc.
and @Tiwa, Flash is being obsoleted now?
It seems as alive as it's always been, Explain please? :P
Btw guys i'm not planning on doing this for a career, unless there is some data job that requires programming. Every time I ask a electrician in data, they say "Yes theirs programming" but it doesn't seem to be actual code..
BASIC would be toddlerspeak
private void button2_Click(object sender, EventArgs e)
{
public int AttackValue;
AttackValue =int att.Value
}
private void btnCalculateValue(){
int attackValue=(int)att.getValue();
}
or evenprivate void btnCalculateValue(){
try{
int attackValue=Integer.parseInt(att.getValue());//for string values
}catch(Exception eek){}//not a number or a string you complete moron
}
public void Method()
{
int localVariable;
localVariable = (int) att.Value; //Not sure if the explicit cast is required here, as there is no context.
}
public class MyClass
{
public int SomeClassVariable;
public void SomeMethod()
{
SomeClassVariable = 1;
}
}
int number;
bool isNumber = Int32.TryParse(att.Value, out number);
C#I do not write programs to fail by accident.Code: [Select]int number;
bool isNumber = Int32.TryParse(att.Value, out number);
I do not write programs to fail by accident.
If they fail, it is the users fault and you should yell at them until they leave the immediate area.
if(!isNumber)
{
YellAtuser();
}
How about this guys.
Start me off with an idea to do. Something extremely basic. I'll get started from there.
public String getResult(Card card1,Card card2){
String name1=card1.getName();
String name2=card2.getName();
String result="Wins";
if(name1.equals("Scissors")&&name2.equals("Paper"))return result;
if(name1.equals("Paper")&&name2.equals("Rock"))return result;
if(name1.equals("Rock")&&name2.equals("Rock"))return result;
if(name1.equals(name2))return "Draws";
return "Loses";
}
Now: Instead of 'losing' or 'winning', each player does a certain amount of damage to each other until one person runs out of health and dies. Replace 'player' with 'Pokemon' and you're on your way to making Pokemon.getLocationOnScreen(), is the correct approach..? Needs to be run after the layout has been performed.
Yuck: [url]http://stackoverflow.com/questions/19497402/get-position-of-imageview-relative-to-screen-programmatically[/url] ([url]http://stackoverflow.com/questions/19497402/get-position-of-imageview-relative-to-screen-programmatically[/url])
Make something that takes two whole numbers, A and B. Return the result that is equivalent to A^B.
namespace WindowsFormsApplication3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public Double Variable, Variable2, Result; //Haha fuck you I used a public variable!
private void textBox2_TextChanged(object sender, EventArgs e)
{
Double.TryParse(textBox2.Text, out Variable2); // This is the part where you call me an idiot for not using an int
Result = Math.Pow(Variable, Variable2);
label1.Text = Result.ToString();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
Double.TryParse(textBox1.Text,out Variable);
Result = Math.Pow(Variable, Variable2);
label1.Text = Result.ToString(); // Repeating the two lines probably wasn't needed but I wanted it to auto update.
}
}
}