APETYPE/practice
c·passage intermediate
Desktop Required to Type
Desktop Recommended for Code Typing
ApeType code transcription is engineered for physical mechanical and laptop keyboards with syntax navigation. Mobile on-screen keyboards cannot provide authentic typing cadence.
You can see the leaderboard hereTop Typists
view all1/ 25
1
#include <stdio.h>↵
2
#include <stdbool.h>↵
3
↵
4
#define BUFFER_CAPACITY 16↵
5
↵
6
typedef struct {↵
7
int data[BUFFER_CAPACITY];↵
8
int head;↵
9
int tail;↵
10
int count;↵
11
} RingBuffer;↵
12
↵
13
void rb_init(RingBuffer *rb) {↵
14
rb->head = 0;↵
15
rb->tail = 0;↵
16
rb->count = 0;↵
17
}↵
18
↵
19
bool rb_push(RingBuffer *rb, int item) {↵
20
if (rb->count >= BUFFER_CAPACITY) return false;↵
21
rb->data[rb->tail] = item;↵
22
rb->tail = (rb->tail + 1) % BUFFER_CAPACITY;↵
23
rb->count++;↵
24
return true;↵
25
}
tab+enter- restart
esc- restart