WIP
This commit is contained in:
parent
b0db6717ca
commit
7626d24fad
20
it/dot.py
Normal file
20
it/dot.py
Normal file
@ -0,0 +1,20 @@
|
||||
def main(buffer, command):
|
||||
if len(command) == 2 and (command[1].isdigit() or command[1] in {"^","$"}):
|
||||
if command[1].isdigit():
|
||||
dot = int(command[1])
|
||||
elif command[1] == "^":
|
||||
dot = buffer.carat()
|
||||
elif command[1] == "$":
|
||||
dot = buffer.dollar()
|
||||
elif len(command) == 3 and command[1] in {"+","-"} and command[2].isdigit():
|
||||
if command[1] == "+":
|
||||
dot = buffer.dot + int(command[2])
|
||||
elif command[1] == "-":
|
||||
dot = buffer.dot - int(command[2])
|
||||
|
||||
if not("dot" in locals()) or dot < buffer.carat() or dot > buffer.dollar():
|
||||
print("?")
|
||||
else:
|
||||
buffer.dot = dot
|
||||
|
||||
return buffer
|
Loading…
Reference in New Issue
Block a user