From 7a8d2bcd75d88a5429937bf551878c55e1dcf0fd Mon Sep 17 00:00:00 2001 From: Melodi <62381002+Melodi17@users.noreply.github.com> Date: Wed, 6 Aug 2025 22:36:34 +1000 Subject: moved everything to seperate projects, and started compiler work + push and pop instructions added --- Emulator/Extensions.cs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Emulator/Extensions.cs (limited to 'Emulator/Extensions.cs') diff --git a/Emulator/Extensions.cs b/Emulator/Extensions.cs new file mode 100644 index 0000000..3cc980d --- /dev/null +++ b/Emulator/Extensions.cs @@ -0,0 +1,23 @@ +namespace Q1.Emulator; + +using System.Collections.Generic; + +public static class Extensions +{ + public static IEnumerable AllIndexesOf(this IEnumerable arr, T q) + { + var indexes = new List(); + int index = 0; + + foreach (var item in arr) + { + if (EqualityComparer.Default.Equals(item, q)) + { + indexes.Add(index); + } + index++; + } + + return indexes; + } +} \ No newline at end of file -- cgit v1.3.1