Welcome to the Kancolle Wiki!
If you have any questions regarding site content, account registration, etc., please visit the
KanColle Wiki Discord
Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
Module:Calc
(view source)
Revision as of 11:42, 2 November 2021
124 bytes added
,
3 years ago
no edit summary
Line 24:
Line 24:
local sorted = false
local sorted = false
local sequence = nil
local sequence = nil
+
local sequence_length = nil
local sequence_position = nil
local sequence_position = nil
local env = {}
local env = {}
Line 297:
Line 298:
sequence = enumerating_function()
sequence = enumerating_function()
sequence_position = 1
sequence_position = 1
+
sequence_length = #sequence
elseif not sequence then
elseif not sequence then
local buildIterator = Iterator[enumerator]
local buildIterator = Iterator[enumerator]
Line 306:
Line 308:
table.insert(sequence, iterator.current())
table.insert(sequence, iterator.current())
end
end
−
end
+
sequence_length = #sequence
+
end
end
end
if args.sort and sequence and not sorted then
if args.sort and sequence and not sorted then
Line 413:
Line 416:
i = i + 1
i = i + 1
end
end
−
until not
sequence
or sequence_position >
#sequence
+
until not
sequence_length
or sequence_position >
sequence_length
return table.concat(values, args.concat or (args.format == "table" and "" or ", "))
return table.concat(values, args.concat or (args.format == "table" and "" or ", "))
end
end
return { format = function(frame) return interpret_args(U.getTemplateArgs(frame).explicit) end }
return { format = function(frame) return interpret_args(U.getTemplateArgs(frame).explicit) end }
がか
cssedit, gkautomate
7,064
edits
Navigation menu
Personal tools
Log in
Request account
Namespaces
Module
Discussion
Variants
Views
Read
View source
View history
More
Search
Content Navigation
Kancolle Wiki
Random page
Recent changes
Batch Uploading
Current Mini-event
Naval District Saury Festival
Sortie
Sortie
World 1 (Naval Base Waters)
World 2 (Nansei Island Waters)
World 3 (Northern Waters)
World 7 (South Western Waters)
World 4 (Western Waters)
World 5 (Southern Waters)
World 6 (Central Waters)
Events
Shortcuts
Expeditions
Quests
Ships Maximum Status
Equipment
Construction
Development
Akashi's Improvement Arsenal
Shop
Inventory
Combat Mechanics
Glossary
Drop List
Interviews
Tutorials
How to Register
How To Play
Leveling
Resource Farming
Ship Priority
Equipment Setup
Akashi Upgrades
Event Preparation
Troubleshooting
FAQ
Community
Help
Sandbox
Tools
Upload file
Special pages
Printable version