Initial commit
Build, test, deploy / site (push) Failing after 15m13s

This commit is contained in:
alexm committed 2026-11-12 22:24:02 -05:00
commit e092cb029c
252 files changed
+35037

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
// CALL: COUNT_BASE('A', "GATTACA")
// EXPECT: COUNT_BASE returned 3
// How many positions of T hold the base B.
FUNCTION COUNT_BASE(B : CHAR, T : STRING) RETURNS INTEGER
// Set up
DECLARE N : INTEGER
DECLARE Total : INTEGER
N <- LENGTH(T)
Total <- 0
// Visit each position
FOR I <- 0 TO N
// Test this position
IF T[I] == B THEN
// Update the running total
Total <- Total + 1
ENDIF
NEXT I
// Report
RETURN Total
ENDFUNCTION