Steam ID: STEAM_0:1:221617357 Joined: Thu May 19, 2016 9:30 am Posts: 2168 Location: United Kingdom
hey i wanted to share what I've been doing in college today!
This is my second year in Level 3 IT and it's going pretty well.
At the minute in Programming, we are currently doing Object Oriented Programming, yeah.
We have been practicing nd stuff on Windows Form Applications and have been producing some small things.
Last year we were doing Procedural Programming, we were using Console Applications for that.
Today we did some excersises and had to do one task on our own, which was create 3 buttons using code (without using tool box to draw it) using the Button code and assigning a variable which is basically the name of the button, example:
Button EgNForums; <- This just means when the variable EgNForums is used, it refers to a button as I believe. public Form1();
to create a button with the name EgNForums, all you have to do is:
MessageBox.Show("This is not the lady. please try again");
}
}
}
The problem is, when you click one of the buttons and it displays you found the lady, it doesnt randomize, it is the same button each time and I want to work on randomizing it making it change buttons each time it is debugged or ran.
1.Join EgN [ X ] 2.Become a Recruit [ X ] 3.Become an EgN Member [ X ] 4.Become a Admin [ X ] 5.Become an Elite [ X ] 6.Become a Veteran [ X ] 7.Become a part of Events Team [ X ] 8.Become a Manager [ ] 9.Become a Staff [ X ] 10.Become an Advisor [ ] 11.Become the next EgN Leader! [ ]
EgN| Mr Geeza™ : Why do I always get you and sinister mixed up lol sorry xD EgN-S| Phillip: Cause you a racist
Jafari asks the wall:What is the meaning of life? The wall responds with:Kill yourself.DUN DUN DUUUUUUUUUUN EgN-S| Mr.GoldGames:I asked for a demotion, where's my demotion at? 1 month later.... The following people have been recognised for their service to the community:
Veteran to Staff Mr.GoldGames
EgN-S| Mr.GoldGames: I ask for a demotion but I got a promotion instead? Life sucks sometimes.
Last edited by Geeza on Wed Jan 11, 2017 8:30 am, edited 1 time in total.
Steam ID: STEAM_0:1:22040504 Joined: Mon Jan 04, 2016 12:13 am Posts: 1404 Location: Philadelphia, PA
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;
private string generateRandomText() { int randomNumber = new Random().Next(1, 3);
switch (randomNumber() { case 1: return "Random lady one"; break; case 2: return "Random lady two"; break; case 3: return "Random lady three"; break; default: return "Random lady default"; break; } } }
}
gg no re
Gonna revise your Levi's with physical harm Put divets in the rivets with my physical arm Gonna beat those jeans, gonna dip em in slime Turn your 501s into 499s
The Senate: Did you ever hear the tragedy of Darth Plagueis The Wise? Anakin: No The Senate: I thought not. It’s not a story the Jedi would tell you. It’s a Sith legend. Darth Plagueis was a Dark Lord of the Sith, so powerful and so wise he could use the Force to influence the midichlorians to create life… He had such a knowledge of the dark side, he could even keep the ones he cared about from dying. Anakin: He could actually save people from death? The Senate: The dark side of the Force is a pathway to many abilities some consider to be unnatural. Anakin: What happened to him? The Senate: He became so powerful… the only thing he was afraid of was losing his power, which eventually, of course, he did. Unfortunately, he taught his apprentice everything he knew, then his apprentice killed him in his sleep. Ironic. He could save others from death, but not himself. Anakin: Is it possible to learn this power? The Senate: Not from a Jedi.
Last edited by CharlieKelly on Tue Jan 10, 2017 1:19 pm, edited 1 time in total.
Last year you did some small C++ console apps (could've been C# too)
and now you're learning .NET Visual Studio with C#
I'm not sure if it's just how you pasted it in your [code] tag, but the formatting isn't all that great
Indentation and commenting your code is key to becoming a better developer. Especially when you want others to critique your work. If you ever need help I can show you some pointers but I (and I hope nobody else) will be doing your homework for you
Steam ID: STEAM_0:1:22040504 Joined: Mon Jan 04, 2016 12:13 am Posts: 1404 Location: Philadelphia, PA
Yiggles Moto wrote:
From the looks of it and by what you're saying,
Last year you did some small C++ console apps (could've been C# too)
and now you're learning .NET Visual Studio with C#
I'm not sure if it's just how you pasted it in your [code] tag, but the formatting isn't all that great
Indentation and commenting your code is key to becoming a better developer. Especially when you want others to critique your work. If you ever need help I can show you some pointers but I (and I hope nobody else) will be doing your homework for you
edit: gg charlie
Yea, Im just that bored at work.
Gonna revise your Levi's with physical harm Put divets in the rivets with my physical arm Gonna beat those jeans, gonna dip em in slime Turn your 501s into 499s
The Senate: Did you ever hear the tragedy of Darth Plagueis The Wise? Anakin: No The Senate: I thought not. It’s not a story the Jedi would tell you. It’s a Sith legend. Darth Plagueis was a Dark Lord of the Sith, so powerful and so wise he could use the Force to influence the midichlorians to create life… He had such a knowledge of the dark side, he could even keep the ones he cared about from dying. Anakin: He could actually save people from death? The Senate: The dark side of the Force is a pathway to many abilities some consider to be unnatural. Anakin: What happened to him? The Senate: He became so powerful… the only thing he was afraid of was losing his power, which eventually, of course, he did. Unfortunately, he taught his apprentice everything he knew, then his apprentice killed him in his sleep. Ironic. He could save others from death, but not himself. Anakin: Is it possible to learn this power? The Senate: Not from a Jedi.
Steam ID: STEAM_0:1:22040504 Joined: Mon Jan 04, 2016 12:13 am Posts: 1404 Location: Philadelphia, PA
Yiggles Moto wrote:
, take a look at Charlie's code. I hope that's how you have yours indented, etc in your actual code...
, gg no re
Ya I was gonna quickly show the new function, but I just couldn't handle the crappy formatting, it was killing me inside.
also () { }
>
() { }
ILL FITE YA IF YOU DISAGREE
Gonna revise your Levi's with physical harm Put divets in the rivets with my physical arm Gonna beat those jeans, gonna dip em in slime Turn your 501s into 499s
The Senate: Did you ever hear the tragedy of Darth Plagueis The Wise? Anakin: No The Senate: I thought not. It’s not a story the Jedi would tell you. It’s a Sith legend. Darth Plagueis was a Dark Lord of the Sith, so powerful and so wise he could use the Force to influence the midichlorians to create life… He had such a knowledge of the dark side, he could even keep the ones he cared about from dying. Anakin: He could actually save people from death? The Senate: The dark side of the Force is a pathway to many abilities some consider to be unnatural. Anakin: What happened to him? The Senate: He became so powerful… the only thing he was afraid of was losing his power, which eventually, of course, he did. Unfortunately, he taught his apprentice everything he knew, then his apprentice killed him in his sleep. Ironic. He could save others from death, but not himself. Anakin: Is it possible to learn this power? The Senate: Not from a Jedi.
https://www.redditgifts.com/?inv=CMv5 Join reddit gifts and get free items but you do have to send back gifts or you'll get penalized After reading every EgN Post
Steam ID: STEAM_0:1:22040504 Joined: Mon Jan 04, 2016 12:13 am Posts: 1404 Location: Philadelphia, PA
YigglesMoto wrote:
I have never used
Code:
function() { //code }
It just kills me to even look at it
Yea I always like the first version... but looking at my codebase I've been using that way almost exclusively lmao, didn't even notice. I think it just auto-formats like that in Visual Studio and I've been too lazy to change it.
Fuck it, as long as its consistent idgaf.
Gonna revise your Levi's with physical harm Put divets in the rivets with my physical arm Gonna beat those jeans, gonna dip em in slime Turn your 501s into 499s
The Senate: Did you ever hear the tragedy of Darth Plagueis The Wise? Anakin: No The Senate: I thought not. It’s not a story the Jedi would tell you. It’s a Sith legend. Darth Plagueis was a Dark Lord of the Sith, so powerful and so wise he could use the Force to influence the midichlorians to create life… He had such a knowledge of the dark side, he could even keep the ones he cared about from dying. Anakin: He could actually save people from death? The Senate: The dark side of the Force is a pathway to many abilities some consider to be unnatural. Anakin: What happened to him? The Senate: He became so powerful… the only thing he was afraid of was losing his power, which eventually, of course, he did. Unfortunately, he taught his apprentice everything he knew, then his apprentice killed him in his sleep. Ironic. He could save others from death, but not himself. Anakin: Is it possible to learn this power? The Senate: Not from a Jedi.
Yea I always like the first version... but looking at my codebase I've been using that way almost exclusively lmao, didn't even notice. I think it just auto-formats like that in Visual Studio and I've been too lazy to change it.
Users browsing this forum: No registered users and 2 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum