7 added 1032 characters in body
source | link

Simple! Here are 2 different ways of doing it.

Counting maximum number of spells

Ok, so let's see how Sorcerer gets spells.

enter image description here

Sorcerers learn 1 spell each level. They can also swap out 1 spell per level. So now we count, for each spell level, how many spells they could have. For sorcerer, its quite easy, it's just 2 spells per level with that spell slot.

  • Level 2 (or lower): 4 spells
  • Level 3 (or lower): 4 spells
  • Level 4 (or lower): 4 spells
  • Level 5 (or lower): 2 spells

Now we go backwards, starting at the highest spell level. Your sorcerer has a valid number of 5th level spells. Then 4th level. We see that it is invalid, he can't have 5 of them.

Imagine now that he actually had some level 3 spell instead of Far Step (5th). Following the same algorithm, he had a valid number of "Level 5 (or lower)" spells (one of 5th level, and one of 4th). Then there are 4 lvl4 spells, also valid. Then 3 lvl3 spells, also valid.

Seems complicated, but its just summing a few times.


Here's the 2nd way.

Matching spells

Ok, so let's see how Sorcerer gets spells.

enter image description here

Sorcerers learn 1 spell each level. If no spells were relearned, then he should have the following 10 spells:

1 1 1 2 2 3 3 4 4 5

So, your list contains

1 3 3 4 4 4 4 4 5 5

We can scratch those that match right away (in bold), and your list is reduced to

_ _ _ 4 4 4 _ _ 5 _

So now all we have to is count how many levels there have been where the player has slots of levels 4 and 5. You don't repeat levels (since you can only switch 1 spell per level). If the amount of levels is smaller than the amount of unmatched spells, then it is an invalid spell selection. It is easier to do this backwards, starting with higher levels.

In your case, the player has 1 level with a 5th level slot. Meaning that the single unmatched 5th lvl spell is valid. After this, the player has 2 levels with a 4th level slot. Because he has 3 lvl4 spells, then this character is not valid.

Simple! Here are 2 different ways of doing it.

Ok, so let's see how Sorcerer gets spells.

enter image description here

Sorcerers learn 1 spell each level. They can also swap out 1 spell per level. So now we count, for each spell level, how many spells they could have. For sorcerer, its quite easy, it's just 2 spells per level with that spell slot.

  • Level 2 (or lower): 4 spells
  • Level 3 (or lower): 4 spells
  • Level 4 (or lower): 4 spells
  • Level 5 (or lower): 2 spells

Now we go backwards, starting at the highest spell level. Your sorcerer has a valid number of 5th level spells. Then 4th level. We see that it is invalid, he can't have 5 of them.

Imagine now that he actually had some level 3 spell instead of Far Step (5th). Following the same algorithm, he had a valid number of "Level 5 (or lower)" spells (one of 5th level, and one of 4th). Then there are 4 lvl4 spells, also valid. Then 3 lvl3 spells, also valid.

Seems complicated, but its just summing a few times.


Here's the 2nd way.

Ok, so let's see how Sorcerer gets spells.

enter image description here

Sorcerers learn 1 spell each level. If no spells were relearned, then he should have the following 10 spells:

1 1 1 2 2 3 3 4 4 5

So, your list contains

1 3 3 4 4 4 4 4 5 5

We can scratch those that match right away (in bold), and your list is reduced to

_ _ _ 4 4 4 _ _ 5 _

So now all we have to is count how many levels there have been where the player has slots of levels 4 and 5. You don't repeat levels (since you can only switch 1 spell per level). If the amount of levels is smaller than the amount of unmatched spells, then it is an invalid spell selection. It is easier to do this backwards, starting with higher levels.

In your case, the player has 1 level with a 5th level slot. Meaning that the single unmatched 5th lvl spell is valid. After this, the player has 2 levels with a 4th level slot. Because he has 3 lvl4 spells, then this character is not valid.

Simple! Here are 2 different ways of doing it.

Counting maximum number of spells

Ok, so let's see how Sorcerer gets spells.

enter image description here

Sorcerers learn 1 spell each level. They can also swap out 1 spell per level. So now we count, for each spell level, how many spells they could have. For sorcerer, its quite easy, it's just 2 spells per level with that spell slot.

  • Level 2 (or lower): 4 spells
  • Level 3 (or lower): 4 spells
  • Level 4 (or lower): 4 spells
  • Level 5 (or lower): 2 spells

Now we go backwards, starting at the highest spell level. Your sorcerer has a valid number of 5th level spells. Then 4th level. We see that it is invalid, he can't have 5 of them.

Imagine now that he actually had some level 3 spell instead of Far Step (5th). Following the same algorithm, he had a valid number of "Level 5 (or lower)" spells (one of 5th level, and one of 4th). Then there are 4 lvl4 spells, also valid. Then 3 lvl3 spells, also valid.

Seems complicated, but its just summing a few times.


Matching spells

Ok, so let's see how Sorcerer gets spells.

enter image description here

Sorcerers learn 1 spell each level. If no spells were relearned, then he should have the following 10 spells:

1 1 1 2 2 3 3 4 4 5

So, your list contains

1 3 3 4 4 4 4 4 5 5

We can scratch those that match right away (in bold), and your list is reduced to

_ _ _ 4 4 4 _ _ 5 _

So now all we have to is count how many levels there have been where the player has slots of levels 4 and 5. You don't repeat levels (since you can only switch 1 spell per level). If the amount of levels is smaller than the amount of unmatched spells, then it is an invalid spell selection. It is easier to do this backwards, starting with higher levels.

In your case, the player has 1 level with a 5th level slot. Meaning that the single unmatched 5th lvl spell is valid. After this, the player has 2 levels with a 4th level slot. Because he has 3 lvl4 spells, then this character is not valid.

6 added 1032 characters in body
source | link

Not simple, but doable.Simple! Here are 2 different ways of doing it.

Ok, so let's see how Sorcerer gets spells.

enter image description here

Sorcerers learn 1 spell each level. They can also swap out 1 spell per level. So now we count, for each spell level, how many spells they could have. For sorcerer, its quite easy, it's just 2 spells per level with that spell slot.

  • Level 2 (or lower): 4 spells
  • Level 3 (or lower): 4 spells
  • Level 4 (or lower): 4 spells
  • Level 5 (or lower): 2 spells

Now we go backwards, starting at the highest spell level. Your sorcerer has a valid number of 5th level spells. Then 4th level. We see that it is invalid, he can't have 5 of them.

Imagine now that he actually had some level 3 spell instead of Far Step (5th). Following the same algorithm, he had a valid number of "Level 5 (or lower)" spells (one of 5th level, and one of 4th). Then there are 4 lvl4 spells, also valid. Then 3 lvl3 spells, also valid.

Seems complicated, but its just summing a few times.


Here's the 2nd way.

Ok, so let's see how Sorcerer gets spells.

enter image description here

Sorcerers learn 1 spell each level. If no spells were relearned, then he should have the following 10 spells:

1 1 1 2 2 3 3 4 4 5

So, your list contains

1 3 3 4 4 4 4 4 5 5

We can scratch those that match right away (in bold), and your list is reduced to

_ _ _ 4 4 4 _ _ 5 _

So now all we have to is count how many levels there have been where the player has slots of levels 4 and 5. You don't repeat levels (since you can only switch 1 spell per level). If the amount of levels is smaller than the amount of unmatched spells, then it is an invalid spell selection. It is easier to do this backwards, starting with higher levels.

In your case, the player has 1 level with a 5th level slot. Meaning that the single unmatched 5th lvl spell is valid. After this, the player has 2 levels with a 4th level slot. Because he has 3 lvl4 spells, then this character is not valid.

Not simple, but doable...

Ok, so let's see how Sorcerer gets spells.

enter image description here

Sorcerers learn 1 spell each level. If no spells were relearned, then he should have the following 10 spells:

1 1 1 2 2 3 3 4 4 5

So, your list contains

1 3 3 4 4 4 4 4 5 5

We can scratch those that match right away (in bold), and your list is reduced to

_ _ _ 4 4 4 _ _ 5 _

So now all we have to is count how many levels there have been where the player has slots of levels 4 and 5. You don't repeat levels (since you can only switch 1 spell per level). If the amount of levels is smaller than the amount of unmatched spells, then it is an invalid spell selection. It is easier to do this backwards, starting with higher levels.

In your case, the player has 1 level with a 5th level slot. Meaning that the single unmatched 5th lvl spell is valid. After this, the player has 2 levels with a 4th level slot. Because he has 3 lvl4 spells, then this character is not valid.

Simple! Here are 2 different ways of doing it.

Ok, so let's see how Sorcerer gets spells.

enter image description here

Sorcerers learn 1 spell each level. They can also swap out 1 spell per level. So now we count, for each spell level, how many spells they could have. For sorcerer, its quite easy, it's just 2 spells per level with that spell slot.

  • Level 2 (or lower): 4 spells
  • Level 3 (or lower): 4 spells
  • Level 4 (or lower): 4 spells
  • Level 5 (or lower): 2 spells

Now we go backwards, starting at the highest spell level. Your sorcerer has a valid number of 5th level spells. Then 4th level. We see that it is invalid, he can't have 5 of them.

Imagine now that he actually had some level 3 spell instead of Far Step (5th). Following the same algorithm, he had a valid number of "Level 5 (or lower)" spells (one of 5th level, and one of 4th). Then there are 4 lvl4 spells, also valid. Then 3 lvl3 spells, also valid.

Seems complicated, but its just summing a few times.


Here's the 2nd way.

Ok, so let's see how Sorcerer gets spells.

enter image description here

Sorcerers learn 1 spell each level. If no spells were relearned, then he should have the following 10 spells:

1 1 1 2 2 3 3 4 4 5

So, your list contains

1 3 3 4 4 4 4 4 5 5

We can scratch those that match right away (in bold), and your list is reduced to

_ _ _ 4 4 4 _ _ 5 _

So now all we have to is count how many levels there have been where the player has slots of levels 4 and 5. You don't repeat levels (since you can only switch 1 spell per level). If the amount of levels is smaller than the amount of unmatched spells, then it is an invalid spell selection. It is easier to do this backwards, starting with higher levels.

In your case, the player has 1 level with a 5th level slot. Meaning that the single unmatched 5th lvl spell is valid. After this, the player has 2 levels with a 4th level slot. Because he has 3 lvl4 spells, then this character is not valid.

5 Rollback to Revision 1
source | link

Simple!Not simple, but doable...

Ok, so let's see how Sorcerer gets spells.

enter image description here

Sorcerers learn 1 spell each level. TheyIf no spells were relearned, then he should have the following 10 spells:

1 1 1 2 2 3 3 4 4 5

So, your list contains

1 3 3 4 4 4 4 4 5 5

We can also swap out 1 spell per level.scratch those that match right away (in bold), and your list is reduced to

_ _ _ 4 4 4 _ _ 5 _

So now all we have to is count, for each spell level, how many spells they couldlevels there have been where the player has slots of levels 4 and 5. For sorcerer, its quite easy, it's just 2 spellsYou don't repeat levels (since you can only switch 1 spell per level). If the amount of levels is smaller than the amount of unmatched spells, then it is an invalid spell selection. It is easier to do this backwards, starting with that spell slothigher levels.

  • Level 2 (or lower): 4 spells
  • Level 3 (or lower): 4 spells
  • Level 4 (or lower): 4 spells
  • Level 5 (or lower): 2 spells

Now we go backwardsIn your case, starting at the highest spell level. Your sorcererplayer has 1 level with a valid number of 5th level spells. Then 4th level. We see that it is invalid, he can't have 5 of them slot.

Imagine now Meaning that he actually had some level 3the single unmatched 5th lvl spell instead of Far Step (5th)is valid. Following the same algorithmAfter this, he hadthe player has 2 levels with a valid number of "Level 5 (or lower)" spells (one of 5th level, and one of 4th). Then there are 4 lvl4 spells, also valid level slot. ThenBecause he has 3 lvl3lvl4 spells, alsothen this character is not valid.

Seems complicated, but its just summing a few times.

Simple!

Ok, so let's see how Sorcerer gets spells.

enter image description here

Sorcerers learn 1 spell each level. They can also swap out 1 spell per level. So now we count, for each spell level, how many spells they could have. For sorcerer, its quite easy, it's just 2 spells per level with that spell slot.

  • Level 2 (or lower): 4 spells
  • Level 3 (or lower): 4 spells
  • Level 4 (or lower): 4 spells
  • Level 5 (or lower): 2 spells

Now we go backwards, starting at the highest spell level. Your sorcerer has a valid number of 5th level spells. Then 4th level. We see that it is invalid, he can't have 5 of them.

Imagine now that he actually had some level 3 spell instead of Far Step (5th). Following the same algorithm, he had a valid number of "Level 5 (or lower)" spells (one of 5th level, and one of 4th). Then there are 4 lvl4 spells, also valid. Then 3 lvl3 spells, also valid.

Seems complicated, but its just summing a few times.

Not simple, but doable...

Ok, so let's see how Sorcerer gets spells.

enter image description here

Sorcerers learn 1 spell each level. If no spells were relearned, then he should have the following 10 spells:

1 1 1 2 2 3 3 4 4 5

So, your list contains

1 3 3 4 4 4 4 4 5 5

We can scratch those that match right away (in bold), and your list is reduced to

_ _ _ 4 4 4 _ _ 5 _

So now all we have to is count how many levels there have been where the player has slots of levels 4 and 5. You don't repeat levels (since you can only switch 1 spell per level). If the amount of levels is smaller than the amount of unmatched spells, then it is an invalid spell selection. It is easier to do this backwards, starting with higher levels.

In your case, the player has 1 level with a 5th level slot. Meaning that the single unmatched 5th lvl spell is valid. After this, the player has 2 levels with a 4th level slot. Because he has 3 lvl4 spells, then this character is not valid.

4 deleted 277 characters in body
source | link
3 deleted 277 characters in body
source | link
2 missing context
source | link
1
source | link