WurstScript

1 program Added 2026-02-23T00:00:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: enabled Evidence Report issue View issues
Aliases: Wurst
Provenance: commit fe9d0aa4d4 · authored 2026-02-23T23:41:25+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

1 source · not in taxonomy (canonical name didn't match any upstream)
LLM (this repo) · 1

Related languages

URScript (0.39)ChatScript (0.35)VoltScript (0.35)ZScript (0.33)BrightScript (0.32)

LLM-contributed programs

LinkedList generic class

Provenance: commit fe9d0aa4d4 · authored 2026-02-23T23:41:25+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch enabled
code.wurst · added: 2026-02-23T00:00:00Z
package LinkedList
import NoWurst
import TypeCasting
import Integer
import String
import ClosureForGroups
import Real

/**
 * Doubly-linked list implementation that implements all common list, stack and queue operations.
 * Permits all elements (including null).
 * Use the Typecasting package if you require lists of warcraft handles.
 * LinkedLists should be generally used anywhere you need a list, because they are the most versatile
 * and fast in common operations. If you need faster contains or access operations on big lists,
 * use HashList. If you want to limit each element's occurance to one, consider HashSet.
 */
public class LinkedList<T>
	private var dummy = new LLEntry<T>(null, null, null)
	protected var size = 0

	private LLIterator<T> staticItr = null
	private LLBackIterator<T> staticBackItr = null

	/** Creates a new list by copying all elements from another list into it */
	construct(thistype base)
		dummy.next = dummy
		dummy.prev = dummy
		for elem in base
			add(elem)

	/** Creates a new empty list */
	construct()
		dummy.next = dummy
		dummy.prev = dummy

	/** Adds one or more elements to the end of the list (top of stack, beginning of queue) */
	function add(vararg T elems)
		for elem in elems
			let entry = new LLEntry<T>(elem, dummy.prev, dummy)
			dummy.prev.next = entry
			dummy.prev = entry
			size++

	/** Adds all elements from elems to the end of this list */
	function addAll(LinkedList<T> elems)
		for elem in elems
			add(elem)

	/** Adds all elements from the other list to the end of this list and removes them from the provided list.

		It does not add/remove elements internally, only the internal pointers of the list nodes are re-pointed.
		The other list will be empty, but not destroyed. */
	function splice(LinkedList<T> other)
		dummy.prev.next = other.dummy.next
		dummy.prev.next.prev = dummy.prev
		dummy.prev = other.dummy.prev
		dummy.prev.next = dummy
		size += other.size
		other.dummy.next = other.dummy
		other.dummy.prev = other.dummy
		other.size = 0

	/** Returns the element at the specified index */
	function get(int index) returns T
		return getEntry(index).elem

	/** Returns the index of the specified element or -1 is it doesn't exist */
	function indexOf(T t) returns int
		var entry = dummy.next
		var idx = 0
		while entry != dummy
			if entry.elem == t
				return idx
			entry = entry.next
			idx++
		return -1

	/** Sets the element at the specified index */
	function set(int index, T elem)
		getEntry(index).elem = elem

Contribute — propose a file extension

Tell us where to find evidence about WurstScript (mapped to pl/wurstscript). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/WurstScript/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Wunnel Wuthering Heights →