Login to ZARP





TOPIC: Any tips?

Any tips? 6 years 4 months ago #1061799

Made my first Windows Form Application in C# and thought i may as well post it here. You pretty much just enter the values for each section (Nuke Amount is how many nukes you plan on launching) and it'll display how much profit you will earn if you're successful with each nuke.

Warning: Spoiler! [ Click to expand ]

Looks better than my Console Application that did the same thing so imma say this was a success.

Source Code for nerds:
Warning: Spoiler! [ Click to expand ]


Not sure if anyone else uses C#, but for those of you that do i would appreciate some tips because i'm new.
  • bunnyslippers69
  • bunnyslippers69's Avatar
  • Offline
  • Diamond Boarder
  • ZARP VIP
  • Posts: 3539
  • Thanks received: 1185
  • Karma: 0
Last Edit: 6 years 4 months ago by bunnyslippers69.
Login or register to post a reply.

Any tips? 6 years 4 months ago #1061804

C# is my jam (is daily driver language for my work), I'll review when I'm home
  • .uzi
  • .uzi's Avatar
  • Offline
  • Former Community Manager
  • ZARP VIP
  • Foos yer doos?
  • Posts: 6009
  • Thanks received: 2444
  • Karma: 123
Login or register to post a reply.

Any tips? 6 years 4 months ago #1061830

Hire somebody that is good in this junk.
  • Katje
  • Katje's Avatar
  • Offline
  • User is blocked
  • ZARP VIP
  • Posts: 5286
  • Thanks received: 844
  • Karma: -73
Login or register to post a reply.

Any tips? 6 years 4 months ago #1061869

may i also show me super rushed and shitty python printer info application lmao
Warning: Spoiler! [ Click to expand ]

All printers added and up to date :)
  • Markus
  • Markus's Avatar
  • Offline
  • Legendary Member
  • ZARP VIP
  • Posts: 5349
  • Thanks received: 1634
  • Karma: -337

Former:
SSRP Superadmin
Community Council Creator (May it rest in piece)
Prophunt Moderator
BHOP Moderator


Login or register to post a reply.

Any tips? 6 years 4 months ago #1061873

I've made some changes but I wasn't able to get any bugs out of it (props to you) even by trying to hijack variable values in debug mode so ez pz.

I know this is a practice project but ideally your form elements, text boxes, buttons etc, should have some kind of strict naming convention to make them easier to reference in code: stackoverflow.com/questions/1246546/best...i-naming-conventions

Also, C# is x10 easier when you use objects. I've made some changes to your solution and uploaded it to my Google Drive. For example, I set up a BaseItem object that holds all properties that can be shared across anything in ZARP, i.e. price, name etc. (Yes I too spotted the difference in property type in the comment as I uploaded this)



Then you can create a class that inherits from the BaseItem object (inheritance is OP, learn it) like below and plug in any properties that are specific to that object, i.e. nuke detonation time:


Here are my changes to your button click event:


To summarise my changes: I made your event more 'OOP', using objects rather than straight variables in your method or wonky fields in your Form1 class definition.
I added validation after casting the input values for the SCU/Nuke price, validation is never bad so always remember to have it. In this case, Convert.To returns null if the cast fails for whatever reason, which is OK, .ToString() would throw an exception if it failed during cast at runtime.

A couple key things that are handy when working with newer versions of the .NET framework:
  • Ternary opertator ( ?: ), a handy way of putting an if-else statement on one line, syntactically it is (expression) ? value if true : value if false
  • String interpolation ($""), much more efficient when formatting a string with values, string.Format() is also good. Try to avoid using multiple this +'s in a strange as too many becomes very inefficient.
  • .uzi
  • .uzi's Avatar
  • Offline
  • Former Community Manager
  • ZARP VIP
  • Foos yer doos?
  • Posts: 6009
  • Thanks received: 2444
  • Karma: 123
Login or register to post a reply.
The following user(s) said Thank You: bunnyslippers69

Any tips? 6 years 4 months ago #1061877

I don't belong here my brain isn't high enough level
  • Taylor_
  • Taylor_'s Avatar
  • Offline
  • Legendary Member
  • ZARP VIP
  • (:
  • Posts: 3258
  • Thanks received: 866
  • Karma: 36

✯ Legendary Member ✯

✯ Ex Deathrun Head Administrator ✯
✯ Ex Bhop Head Administrator ✯
✯ Ex Surf Head Administrator ✯
✯ Ex SSRP Super Administrator ✯
✯ Ex Prophunt Administrator ✯
✯ Ex Discord Administrator ✯
✯ Ex TeamSpeak Staff ✯
✯ Ex Server Apps Section Mod ✯
✯ Ex SSRP Section Mod ✯


✯Steam✯
Login or register to post a reply.

Any tips? 6 years 4 months ago #1061880

Taylor. wrote:
I don't belong here my brain isn't high enough level
*spits*
  • Markus
  • Markus's Avatar
  • Offline
  • Legendary Member
  • ZARP VIP
  • Posts: 5349
  • Thanks received: 1634
  • Karma: -337

Former:
SSRP Superadmin
Community Council Creator (May it rest in piece)
Prophunt Moderator
BHOP Moderator


Login or register to post a reply.

Any tips? 6 years 4 months ago #1061991

Taylor. wrote:
I don't belong here my brain isn't high enough level
It's not as hard as you might think to learn a programming language, its just confusing at first but you'll get over that confusion with enough practice and dedication. I highly recommend learning Python as your first language if you're interested.
  • Diet Water
  • Diet Water's Avatar
  • Offline
  • Diamond Boarder
  • ZARP VIP
  • Posts: 2948
  • Thanks received: 747
  • Karma: -51
Last Edit: 6 years 4 months ago by Diet Water.
Login or register to post a reply.

Any tips? 6 years 4 months ago #1061996

Diet Water wrote:
Taylor. wrote:
I don't belong here my brain isn't high enough level
It's not as hard as you might think to learn a programming language, its just confusing at first but you'll get over that confusion with enough practice and dedication. I highly recommend learning Python as your first language if you're interested.

i've been doing python 3 years at school but its W H A C K
  • Taylor_
  • Taylor_'s Avatar
  • Offline
  • Legendary Member
  • ZARP VIP
  • (:
  • Posts: 3258
  • Thanks received: 866
  • Karma: 36

✯ Legendary Member ✯

✯ Ex Deathrun Head Administrator ✯
✯ Ex Bhop Head Administrator ✯
✯ Ex Surf Head Administrator ✯
✯ Ex SSRP Super Administrator ✯
✯ Ex Prophunt Administrator ✯
✯ Ex Discord Administrator ✯
✯ Ex TeamSpeak Staff ✯
✯ Ex Server Apps Section Mod ✯
✯ Ex SSRP Section Mod ✯


✯Steam✯
Login or register to post a reply.

Any tips? 6 years 4 months ago #1061997

I'm totally editing this to calculate the bail NPC exploit
  • Tamaninja
  • Tamaninja's Avatar
  • Offline
  • Gold Boarder
  • ZARP VIP
  • wag1
  • Posts: 2603
  • Thanks received: 3821
  • Karma: 245
Login or register to post a reply.
The following user(s) said Thank You: Micky

Any tips? 6 years 4 months ago #1062000

Taylor. wrote:
Diet Water wrote:
Taylor. wrote:
I don't belong here my brain isn't high enough level
It's not as hard as you might think to learn a programming language, its just confusing at first but you'll get over that confusion with enough practice and dedication. I highly recommend learning Python as your first language if you're interested.

i've been doing python 3 years at school but its W H A C K
Python is actually one of the most commonly used languages at an Enterprise level purely for its flexibility, it's a great language
  • .uzi
  • .uzi's Avatar
  • Offline
  • Former Community Manager
  • ZARP VIP
  • Foos yer doos?
  • Posts: 6009
  • Thanks received: 2444
  • Karma: 123
Login or register to post a reply.
The following user(s) said Thank You: dankek

Any tips? 6 years 4 months ago #1062003

if any retard thinks programming is just learning a language and typing like a monkey, he's clearly delusional

props to you for your first program though man, looks sweet

edit: I realised i look like a snide prick but my lungs get cancer quicker than when I smoke when I read these comments, if you're interested in starting as a software engineer, you'll need to know a variety of topics, and a general knowledge of how shit works.
Also, math can appear pointless, and it is in some lines of work, but many times you'll value the logic behind math as it's applicable on programming. I often find myself balls deep into formulas and shit though.

A good starter would be getting """learning""" python to get to know fundamentally applicable parts of programming.

edit2 cause im a cunt: www.amazon.com/Learning-Python-5th-Mark-Lutz/dp/1449355730
that's a good book and it'll introduce you into many concepts you'll find useful
  • dankek
  • dankek's Avatar
  • Offline
  • Banned
  • ZARP VIP
  • Legendary Retard
  • Posts: 2400
  • Thanks received: 997
  • Karma: 23
Last Edit: 6 years 4 months ago by dankek.
Login or register to post a reply.
The following user(s) said Thank You: Tamaninja

Any tips? 6 years 4 months ago #1062004

dankek wrote:
if any retard thinks programming is just learning a language and typing like a monkey, he's clearly delusional

props to you for your first program though man, looks sweet
YEAH MAN YOU ALSO NEED TO ALT TAB EVERYTIME TO CHECK THE YOUTUBE VIDEO
  • Tamaninja
  • Tamaninja's Avatar
  • Offline
  • Gold Boarder
  • ZARP VIP
  • wag1
  • Posts: 2603
  • Thanks received: 3821
  • Karma: 245
Login or register to post a reply.
The following user(s) said Thank You: Micky, .uzi, dankek

Any tips? 6 years 4 months ago #1062118

Tamaninja wrote:
dankek wrote:
if any retard thinks programming is just learning a language and typing like a monkey, he's clearly delusional

props to you for your first program though man, looks sweet
YEAH MAN YOU ALSO NEED TO ALT TAB EVERYTIME TO CHECK THE YOUTUBE VIDEO

Spent wayyyy too much time last night figuring out how to convert a steamid to it's steamid64 counterpart for something i'm currently working on ;), but that was mainly just a billion tabs of reddit pages and other sources.
  • bunnyslippers69
  • bunnyslippers69's Avatar
  • Offline
  • Diamond Boarder
  • ZARP VIP
  • Posts: 3539
  • Thanks received: 1185
  • Karma: 0
Login or register to post a reply.

Time to create page: 0.252 seconds

254 PLAYERS ONLINE

Connect to server View Gametracker DarkRP
8/127
Online
Connect to server View Gametracker Deathrun
0/40
Online
Connect to server View Gametracker TTT
0/47
Online
Connect to server View Gametracker Bhop
0/32
Online
Connect to server View Gametracker Surf
5/32
Online
Connect to server View Gametracker Prop Hunt
0/42
Online
Connect to server View Gametracker Sandbox
0/42
Online
Connect to server Discord
241/953
Online
Top