Bug - Not A Bug my_turncount() VS turns_played()... FIGHT!

Bale

Minion
It appears to me that the functions my_turncount() and turns_played() do the same thing.

I wonder if that is on purpose. Shouldn't turns_played() return turns played (total), not just this ascension's turn count? Pretty much everyone uses my_turncount() so I was surprised to find that the other function does the same thing.

I understand that you may be reluctant to fix turns_played() because it may break someone's script somewhere... (Or maybe not since most uses rely on a change in its value rather than it actual value.) If that is the reason for not making turns_played() different, I'll understand, but I'd like to know.

So... what is the deal with this?
 

heeheehee

Developer
Staff member
Huh. The code for the two functions, incidentally, is exactly the same. (I half-expected one to be derived from the charpane and the other to be from the charsheet. Guess not.)
 

jasonharper

Developer
I did some archaeology, and here's where turns_played() was added:
r4251 | shwei | 2007-07-14 01:56:19 -0500 (Sat, 14 Jul 2007) | 1 line
Changed paths:
M /src/net/sourceforge/kolmafia/KoLmafiaASH.java

Add turns_played function for people who want to write a semirare counter

Even at that point, the function was identical to my_turncount(), which has been around since r946.

I'm inclined to leave both functions alone - I see no reason to punish scripters who chose the wrong side in this epic conflict.
 

jasonharper

Developer
I did some archaeology, and here's where turns_played() was added:
r4251 | shwei | 2007-07-14 01:56:19 -0500 (Sat, 14 Jul 2007) | 1 line
Changed paths:
M /src/net/sourceforge/kolmafia/KoLmafiaASH.java

Add turns_played function for people who want to write a semirare counter

Even at that point, the function was identical to my_turncount(), which has been around since r946.

I'm inclined to leave both functions alone - I see no reason to punish scripters who chose the wrong side in this epic conflict.
 

Bale

Minion
Add turns_played function for people who want to write a semirare counter
The heck?! Why did he think that this would be better for counting semirares than my_turns()? Perhaps he was planning to add something to it that he never got around to completing?
 

philmasterplus

Active member
Bump.

@jasonharper Have you considered deprecating the function? Perhaps coloring the function name in red for ashref. How about printing a blue-colored warning when parsing a script using turns_played()? If it seems too intrusive for players, would displaying deprecation warnings only for validate/verify be okay? The function itself could be removed by the time v15 is released (probably very, very far away).

Also, would it hurt to mark the turns_played() as deprecated in the wiki?
 

slyz

Developer
Marking this as Not A Bug. Jason didn't seem eager to cleanup KoLMafia's source and maybe break a few scripts.
 
Top