MCPcopy Index your code
hub / github.com/TeaCoder52/patcode / isSequentialAsc

Function isSequentialAsc

src/analyze.ts:4–11  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

2import type { CodeLength, CodeAnalysis } from './types'
3
4function isSequentialAsc(code: string): boolean {
5 for (let i = 1; i < code.length; i++) {
6 const prev = Number(code[i - 1])
7 const curr = Number(code[i])
8 if (curr !== (prev + 1) % 10) return false
9 }
10 return true
11}
12
13function isSequentialDesc(code: string): boolean {
14 for (let i = 1; i < code.length; i++) {

Callers 1

analyzeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected