-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo_2.py
executable file
·30 lines (24 loc) · 1.02 KB
/
demo_2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from src.sequences import Sequences
# Define sequences
SEQUENCE_A = ('a', 'b', 'c')
SEQUENCE_B = ('x', 'y', 'z')
# Initialize the Sequences object
sq = Sequences()
# Input sequences into the Sequences object
sq.input_sequence(SEQUENCE_A, 'Sequence A')
sq.input_sequence(SEQUENCE_B, 'Sequence B')
# Simulate partial input and check the state
hots, matches, drops = sq.table_insert_keys(['a', 'b'])
print("Hots", hots) # Output: Hots ('Sequence A',)
print("Matches", matches) # Output: Matches ()
print("Drops", drops) # Output: Drops ()
# Simulate a mismatch
hots, matches, drops = sq.table_insert_keys(['x'])
print("Hots", hots) # Output: Hots ('Sequence B',)
print("Matches", matches) # Output: Matches ()
print("Drops", drops) # Output: Drops ('Sequence A',)
# Complete the matching for Sequence B
hots, matches, drops = sq.table_insert_keys(['y', 'z'])
print("Hots", hots) # Output: Hots ()
print("Matches", matches) # Output: Matches ('Sequence B',)
print("Drops", drops) # Output: Drops ()