The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
It's like a frankenstein of a language that wants to be C# but is like 1/3 c++/stl in how its interfaces look.
plus source level templates - cool sort of, but another cppism.
I find it actually easier to read and port between C# and c++ despite them being so different, because they're at least consistent about their differences. To the point where you can often do editor find replace (-> to . for example) to do a lot of the work for you. The point is, it's a lot more regular. All size() becomes Count. The iterators are pointers, they don't have a bunch of weird methods on them in C++.
It's just straightforward. Reading, writing, porting and thinking in java is creaky or clunky, IMO.
I can't even put my finger on all of it. I just don't like it.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
Inspired by witch the codehoney asking about our ugliest code I looked up some of my earliest code.
I was just getting started and wanted to experiment a bit with inheritance.
So I decided to make a (turn based) Final Fantasy like battle game
It's VB so you're warned... (awesome pictures at the bottom)
Somehow I thought BaseMonster was a good idea (especially notice how I check if the type of Me (this) is not of a specific derived type).
The BackgroundWorker is also pretty neat!
Private m_Name AsStringPrivate m_Level AsIntegerPrivate m_HP AsIntegerPrivate m_CurrentHP AsIntegerPrivate m_MP AsIntegerPrivate m_CurrentMP AsIntegerPrivate m_Strength AsIntegerPrivate m_CurrentStrength AsIntegerPrivate m_Defence AsIntegerPrivate m_CurrentDefence AsIntegerPrivate m_Magic AsIntegerPrivate m_CurrentMagic AsIntegerPrivate m_MagicDef AsIntegerPrivate m_CurrentMagicDef AsIntegerPrivate m_Speed AsIntegerPrivate m_CurrentSpeed AsIntegerPrivate m_Image As Bitmap
PublicEvent Charging(ByVal sender As BaseCharacters.BaseMonster, ByVal e As System.ComponentModel.ProgressChangedEventArgs)
PublicEvent TurnStarted(ByVal sender As BaseCharacters.BaseMonster, ByVal e As System.EventArgs)
PublicEvent TurnEnded(ByVal sender As BaseCharacters.BaseMonster, ByVal e As System.EventArgs)
PublicEvent Killed(ByVal sender As BaseCharacters.BaseMonster, ByVal e As System.EventArgs)
PrivateWithEvents m_Bgw As System.ComponentModel.BackgroundWorker
IfNotTypeOfMeIs BaseHumanoid Then
EndIfEndSub'''<summary>''' This sub must be used to set the properties Name, Level, HP, MP,
''' Strength, Defence, Magic, MagicDefence and Speed of the new Monster.
Me.CurrentHP = Me.HP
Me.CurrentMP = Me.MP
Me.CurrentStrength = Me.Strength
Me.CurrentDefense = Me.Defense
Me.CurrentMagic = Me.Magic
Me.CurrentMagicDef = Me.MagicDef
Me.CurrentSpeed = Me.Speed
EndSubPublicSub Me_TurnEnded(ByVal sender As BaseCharacters.BaseMonster, ByVal e As System.EventArgs) HandlesMe.TurnEnded
EndSub' A lot of properties for the m_Fields after this point...
The BaseDefence is just a bunch of properties that indicate elemental defence.
#Region "Magic Defense"
Private m_AstralDef As DefenceDefinition.DefenceEnum = DefenceDefinition.DefenceEnum.Normal
Private m_DarkDef As DefenceDefinition.DefenceEnum = DefenceDefinition.DefenceEnum.Normal
Private m_EarthDef As DefenceDefinition.DefenceEnum = DefenceDefinition.DefenceEnum.Normal
Private m_FireDef As DefenceDefinition.DefenceEnum = DefenceDefinition.DefenceEnum.Normal
Private m_GravityDef As DefenceDefinition.DefenceEnum = DefenceDefinition.DefenceEnum.Normal
Private m_HealingDef As DefenceDefinition.DefenceEnum = DefenceDefinition.DefenceEnum.FullAbsorb
Private m_HolyDef As DefenceDefinition.DefenceEnum = DefenceDefinition.DefenceEnum.Normal
Private m_IceDef As DefenceDefinition.DefenceEnum = DefenceDefinition.DefenceEnum.Normal
Private m_LightningDef As DefenceDefinition.DefenceEnum = DefenceDefinition.DefenceEnum.Normal
Private m_PoisonDef As DefenceDefinition.DefenceEnum = DefenceDefinition.DefenceEnum.Normal
Private m_WaterDef As DefenceDefinition.DefenceEnum = DefenceDefinition.DefenceEnum.Normal
Private m_WindDef As DefenceDefinition.DefenceEnum = DefenceDefinition.DefenceEnum.Normal
PublicProperty AstralDef() As DefenceDefinition.DefenceEnum
EndGetSet(ByVal value As DefenceDefinition.DefenceEnum)
m_AstralDef = value
A BaseHumanoid is a monster of sorts and unless I'm Barrett from Final Fantasy VII I don't think my main hand is actually a weapon
Private m_OffHand As IOffHand
Private m_MainHand As BaseWeapon
Private m_Magic AsNew List(Of BaseSpell)
' Does nothing.' This sub is replaced with SetHumanProperties. EndSub'''<summary>''' This sub must be used to set the properties Name, Level, HP, MP,
''' Strength, Defence, Magic, MagicDefence, Speed, MainHand and OffHand of the new Humanoid.
PublicReadOnlyProperty GetMagic() As List(Of BaseSpell)
Time to define my Hero!
PublicSubNew(ByVal name AsString)
Me.Name = name
Me.Level = 10Me.Strength = 10Me.HP = 100Me.MP = 10Me.Defense = 10Me.Magic = 10Me.MagicDef = 10Me.Speed = 4Me.Image = My.Resources.super_hero
Me.MainHand = New HealingStaff
Me.AddMagic = New IceWhisper
'Me.AddMagic = New FireBreathEndSubEndClass
PublicFunction GetMonster() As BaseCharacters.BaseMonster Implements ILandscape.GetMonster
Dim random AsNew Random
Dim i AsInteger = random.Next(0, 2)
EndSelectEndFunctionPublicReadOnlyProperty BackGround() As System.Drawing.Bitmap Implements ILandscape.BackGround
VB.NET, not even VB 1 through 6
Although my very first code was in VB4, some 25 years ago (when I was 7 or 8).
I remember writing a quiz in WinForms with questions like "What is this? [image]" and then answers like "dog, cat, whale".
I kept the score and after 10 questions you'd get a (correct) score.
My dad was so proud he even told his customers about it (who'd later become my customers too)
After that I wouldn't write another letter of code for about 20 years and then I wrote the RPG code (the quiz code has long been gone)
Nowadays, my code just glues all kinds of (Azure) services together.
Adventures in 3d design: a continuing frustration.
I'm trying to design something - fairly complex, it's a lid for my Sous vide tank - in Fusion 360, and I'm getting the hang of things, I think. But ... I'd like to check my measurements (and in particular the internal radii) before I even think of buying a 3D printer, much let commiting to actual ABS / PLA.
So ... I'll print a one-to-one paper version of the drawing so far and lay it on the physical object. Easy!
Except Fusion 360 doesn't have a "print to paper" option, even for sketches. You can "Print to 3D" really easily, but not to paper.
It does have a "image" creation which asks for dpi, so I'll try that. Load it into Paintshop Pro for printing and ... it's not to scale, or even close.
Sent from my Amstrad PC 1640 Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!