Monday, July 31, 2023

How should we train men to be military officers?

    The service academies are now a national joke.  They teach very little aside from arrogance and woke Leftism.  They should teach future military officers to be leaders and thinkers.  How could we better go about this task?  What value does a 4 year degree, in this age of reduced (or eliminated) standards, bring to military leadership?  Remember, the ultimate purpose of officers is to lead men into battle and win wars.

    I like Heinlein's idea.  No man shall be eligible for officer training until after he has honorably served no less than two years nor more than ten as an enlisted man.  This weeds out a lot of undesirable candidates.  If you are unwilling to serve amongst the lowest of the low, to put up with the dirty end of the stick, you aren't what we need or want to lead troops into battle.  We also only want patriots.  Anti-American types need not apply.

    After two years enlisted duty, a young man may apply to officer candidate school.  I envision this school as lasting at least six months, at most two years.  The topics taught shall be leadership, psychology, advanced first aid and field hygiene, military history, geography (both physical and human), effective communications (oral and written), basic accounting, technology (heavy on the practical, light on the theoretical), tactics, logistics, military operations, and basic staff work.  Practical courses shall include rigorous physical training (daily), weapons handling (daily), marksmanship (monthly), a martial arts discipline (weekly), close combat (weekly, using airsoft guns), drone use (weekly), wargaming (weekly, starting with miniatures, eventually moving on to board games, and finally computerized staff games).  One week per month shall be spent training in the field or onboard ship.

    Graduation is to be conditional upon successful completion of all courses and activities, honorable and moral conduct throughout, as well as acceptable conduct during a six week final exercise in the field or onboard ship.  Upon graduation, these young men will be commissioned as junior officers, with a service obligation of six years.

    What about doctors and nurses?  They do not lead troops into combat, so they don't get to be officers.  Doctors could be Warrant officers, but honestly, most of them should just be DoD civilians under long term contracts.

    Those are my thoughts on the topic.  What are yours?

Friday, July 28, 2023

FRPG alternate rules

 Abstract wealth:

Wealth is measured in abstract coinage. If you want to buy something, you compare its price with your coinage. If the price equals your coinage, you buy it and lose a coin. If the price is one less, you buy it and lose a coin one third of the time. If the price is two or more coins less, you just buy it. You can't afford anything that costs more coins than you have.

Adding treasure works similarly. Anything worth less than one coin than you have doesn't add to your wealth. One coin less will add to your coinage one chance in six. Treasure equal to your coinage increases it half the time.  Treasure one coin higher than your current wealth is increased one chance in six.

When using slot based encumbrance, your coinage occupies 1/2/3/5/10 slots. When using pounds, your coinage weighs 1/3/10/30/100 pounds. More than that and you need a wagon or magical container.


Alternate spellcasting
Slots and checks in a d20 system.
(Spells have tiers instead of levels to avoid confusion.)
Use the spells per day charts. Casting those spells doesn't require a check, but does use the slots. Daily renewal of spell slots requires a minimum of 6 hours of sleep plus one hour of spellbook study or prayer.
To cast additional spells, the caster makes a spellcasting check at
DC 10 + twice the spell tier. Their casting bonus is their spellcasting level plus stat bonus.
If a caster fails a spellcasting roll by 5 or more, they cannot attempt to cast that spell again until after a full turn of uninterrupted spellbook study or prayer. If they fail by 10 or more, they can't attempt spellcasting checks of spells of that tier or higher until after an uninterrupted hour of spellbook study or prayer.
If a caster makes a roll by 10 or more, something good happens. Examples: Spell is upcast, damage/healing is rolled with advantage/maximized/doubled, spells affects triple the usual targets, spell duration is tripled, area of effect is doubled, allies/enemies in AOE are ignored, caster gets to choose instead of rolling on a random chart, caster regains a used spell slot of that tier or higher, caster heals the spell's tier in hit points...
Cantrips are tier 0 spells. Cantrip checks are made with advantage once the caster gains a tier 2 spell slot. Read Magic is a cantrip.
Caster can attempt to cast a known spell of one tier higher than their chart says they can, but the check is made with disadvantage. Failure by 5 results in the loss of half the spell's tier in hit points.  Failure by 10 results in the loss of the spell's tier in hit points.  These are in addition to the usual penalties.
To upcast a spell (when allowed), either use a higher tier slot, two equal slots, a slot and two of the next lower slots, a slot and a check, or disadvantage on the check.
Turn Undead is a cleric spell-like ability, where the DC is 10 + twice the target's hit dice. For every point the check exceeds the DC, one additional creature (of that DC or lower) is turned. Succeeding by 10 destroys the target, with an additional creature destroyed for every point higher. Failing by 5 or more results in the cleric not being able to attempt to turn that creature again until after an uninterrupted turn of prayer. Failing by 10 results in the cleric not being able to turn any creatures of that power or higher until after an uninterrupted hour of prayer.

Wednesday, July 26, 2023

Referencing and Dereferencing in Nim



Here is an executable guide to how referencing and dereferencing work in Nim. I made this to understand it myself, because there is no explanation in the online manual or either book on Nim.

******************


type
refInt = ref int
var
a: int = 1
b: refInt
c: refInt
d: refInt


# UPDATE
# Use this template to make referencing much easier!

template `-->` [T](receiver: ref T, target: T)=
receiver = cast[ref type(target)](target.addr)

echo a
echo "a ", a.addr.repr
# Sadly, the Nim 2.0.0 update removed the physical addresses from repr
new(b)
b[] = a
echo b[]
echo "b ", b.addr.repr
a = 2
echo a
echo "a ", a.addr.repr
echo b[]
b = cast[ref int](alloc0(sizeOf(a))) # primitive, use new(b) instead
b[] = a
echo b[]
echo "b ", b.addr.repr
a = 3
echo a
echo b[]
b = cast[ref int](a.addr) # this works!
echo b[]
new(c)
c = b
echo "c ", c[]
a = 4
echo "a ", a
echo b[]
echo c[]
echo type(c)
echo "a ", a.addr.repr
echo "b ", b.addr.repr
echo "c ", c.addr.repr
echo ""

var x: array[5, int]
type ArrRef = ref array[5, int]
var y, z : ArrRef
x = [1, 2, 3, 4, 5]
y = cast[ArrRef](x.addr)
# addr provides a ptr type
# cast to convert ptr to ref
z = y
echo "x ", x, " is ", x.addr.repr
# repr is a lower-level version of the $ to-string operator
echo "y ", y[], " is ", y.addr.repr
# [] is dereference, so c[] --> b
echo "z ", z[], " is ", z.addr.repr
echo ""
z[4] = 10
echo "x ", x, " is ", x.addr.repr
echo "y ", y[], " is ", y.addr.repr
echo "z ", z[], " is ", z.addr.repr
new(z)
# use new() to allocate space for the value to be referenced
z[] = x
z[4] = 20
echo ""
echo "x ", x, " is ", x.addr.repr
echo "y ", y[], " is ", y.addr.repr
echo "z ", z[], " is ", z.addr.repr
# only z is now [1, 2, 3, 4, 20]

var q: ArrRef
q --> x