[Question]
  [
Try to create a simple ASCII art scissors animation!
# Challenge
All inputs will be integers -31 through 31.
The output will be an animation (To be outputted *somewhere*, as long as the previous frame is replaced. GIFs are allowed.), separated by (approximately) 1 quarter of a second.
If the input (`n`) is positive:
* The animation should start with `8<`, AKA open scissors.
* The next frame is `8=`. This shows the scissors "cutting".
* A dash (cut mark) is added behind the scissors, and the animation repeats until there are `n` dashes.
If the input is negative:
* The scissors start open and facing towards the left (Like this: `>8`), with `n` spaces in front of it.
* The scissors close and remain facing towards the left (`=8`).
* The scissors re-open, as space is removed, and a dash is added behind the scissors.
If the input is zero:
* Output just the scissors opening and closing, for 10 frames. They can be facing either direction, as long as it is consistent.
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest submission in bytes wins. (Even if your entry clearly won't win because of some sort of newfangled "golfing language", we'd still like to see it.)
Error messages are allowed, as long as the error message itself does not interfere with the animation.
# Example Input and Output Pairs:
(I separated the frames for clarity, but there should be approximately .25 seconds between each frame)
```
Input: 1
Output: 
8<
8=
-8<
Input: 2
Output:
8<
8=
-8<
-8=
--8<
Input: 5
Output:
8<
8=
-8<
-8=
--8<
--8=
---8<
---8=
----8<
----8=
-----8<
Input: 0
Output:
8<
8=
8<
8=
8<
8=
8<
8=
8<
8=
Input: -2
Output:
  >8
  =8
 >8-
 =8-
>8--
Input: -3
Output:
   >8
   =8
  >8-
  =8-
 >8--
 =8--
>8---
```
Enjoy!
  
[Answer]
# [SOGL V0.12](https://github.com/dzaima/SOGLOnline), 53 [bytes](https://github.com/dzaima/SOGL/blob/master/chartable.md)
```
LA0≠?.θ«IA}a∫H.¡*»:B┌* 8+Ƨ<=F2%W+a»b-@*+.0<?↔±}1¼UU░P
```
[Try it Here!](https://dzaima.github.io/SOGLOnline/?code=TEEwJXUyMjYwJTNGLiV1MDNCOCVBQklBJTdEYSV1MjIyQkguJUExKiVCQiUzQUIldTI1MEMqJTIwOCsldTAxQTclM0MlM0RGMiUyNVcrYSVCQmItQCorLjAlM0MlM0YldTIxOTQlQjElN0QxJUJDVVUldTI1OTFQ,inputs=MA__,v=0.12)
[Answer]
# [MATL](https://github.com/lmendo/MATL), ~~59~~ ~~58~~ 57 bytes
```
|EQG~10*+:"&FXx45@q2/kGg*XHY"8Vh61@oGO<Eq*+h4M?G|H-Z"hP]D
```
Try it at [MATL Online!](https://matl.io/?code=%7CEQG%7E10%2a%2B%3A%22%26FXx45%40q2%2FkGg%2aXHY%228Vh61%40oGO%3CEq%2a%2Bh4M%3FG%7CH-Z%22hP%5DD&inputs=5&version=20.6.0) Or see an example run from the offline compiler:
[![enter image description here](https://i.stack.imgur.com/B1c6Z.gif)](https://i.stack.imgur.com/B1c6Z.gif)
[Answer]
# JavaScript (ES2017) + HTML, 165 + 10 bytes
**-16 bytes by @Shaggy**
```
n=>(g=i=>i<-~(n?2*m:9)&&setTimeout(g,250,i+1,s=8+"<>="[i%2?2:n<0|0],o=("-".repeat(i/2)+s).padEnd(m+2),e.innerHTML=(n?n<0?[...o].reverse().join``:o:s)))(0,m=n<0?-n:n)
```
```
<pre id=e>
```
Try it in the below snippet:
```
let globalTimeout;
const _setTimeout = setTimeout;
window.setTimeout = function(){ globalTimeout = _setTimeout.apply(this, arguments); }
// Code above is to support user input
f=
n=>(g=i=>i<-~(n?2*m:9)&&setTimeout(g,250,i+1,s=8+"<>="[i%2?2:n<0|0],o=("-".repeat(i/2)+s).padEnd(m+2),e.textContent=(n?n<0?[...o].reverse().join``:o:s)))(0,m=n<0?-n:n)
// Code below is to support user input
f(10)
const $inp = document.getElementById("inp");
inp.addEventListener("change", ()=>{
  clearTimeout(globalTimeout);
  f(+inp.value);
});
```
```
<input type="number" id="inp" min="-31" max="31" value="10" />
<pre id=e>
```
[Answer]
# TI-BASIC, 173 bytes
```
:"-
:For(X,1,5
:Ans+Ans
:End
:For(X,1,32
:" "+Ans+" →Str1
:End
:ClrHome
:Input N
:N<0→X
:For(A,not(N),abs(N+5not(N
:For(B,4-3X,6-3X-(A=abs(N)),2
:33X-Anot(not(N
:Output(1,16,sub(Str1,33X+32,abs(Ans-1)-NX-31X)+sub(">8=8<8=",B,2)+sub(Str1,Ans+32,1
:rand(11
:End
:End
```
Having the 0 input terminate in a different frame from the others was a very interesting obstacle!
Since TI-BASIC doesn't like empty strings, this maintains at least one dummy character to the left of the scissors, the first of which is constantly a space; to hopefully avoid counting this as part of the *n* spaces for negative inputs, this program begins printing from the rightmost column of the first row, then wraps the remainder of the string downward in order to begin the actual field of animation there, fresh off the first column.
Some notes for an exotic device: TI-BASIC code size is measured in tokens, not characters. For consistent cross-calculator comparisons, we usually ignore byte counts dealing with header lengths (e.g., we subtract 8 from PROGRAM:SCISSORS). Additionally, for routines which are fully well-behaved on the home screen (those lacking in control structures, for the most part), we further eliminate the size of an empty program to "save" on 9 bytes as well. This program in particular is not typable on the home screen, so that liberty won't be taken.
[Answer]
# [Octave](https://www.gnu.org/software/octave/), ~~190~~ 186 bytes
```
k=32+~e((a=abs(n=(z=input(''))+~z*10))+1,1);for i=1:a
clc
k(i:i+1)=[56,61-(s=sign(n))];q=@(m)fprintf(rot90([m ''],s));q(k)
if(i-a)pause(.25)
clc
k(i+1)+=s;q(k)
pause(.25);k(i)=45;end
end
```
[Try it online!](https://tio.run/##RYy9DoIwFEb3PgVb77VgqFoSaW7iexCGisU0SPkpODDw6khijMOXbzgnp6sm87bb1tD5JFYLYMjcA3iChZzv5wk4RxTrcpDp/jKWqOtujBzJ3LDqVbEGXO6ERCpUFmcygUDBPT14xFIPdIMW6350fqph7KZrCkUbcV7GAVEP0CBzNbjEYG/mYOF4UvjL7lFB4Sv9qd4J0kVp6x9s37apDw "Octave – Try It Online") (note: `clc` does not work in TIO, so it's just all the animation frames outputted sequentially). Thanks for @LuisMendo for making me aware of the function `e(...)` in Octave, which is equal to `exp(1)*ones(...)`.
It turns out that inline assignments return only the changed array entries, not the entire array. This means that constructions like `q(k(i+1)+=s)` are not possible, so the program is almost like MATLAB. In fact, the MATLAB entry is only slightly longer,
# MATLAB, ~~198~~ 195 bytes
```
n=input('');n=n+~n*10;a=abs(n);s=sign(n);k=zeros(a+1,1);q=@(k)fprintf(rot90([k ''],s));for i=1:a
k(i:i+1)=[56 61-s];clc
q(k)
if(i-a)pause(.25);
k(i+1)=k(i+1)+s;clc
q(k)
pause(.25)
k(i)=45;end
end
```
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 281 bytes
```
$n=$args[0];$o="8<";$c="8=";function x{sleep .25};if($n-le0){$n=[math]::abs($n);$o=">8";$c="=8";$p=' '*$n;$p+$o;$x;$p+$c;1..$n|%{$p=$p-replace"\s$","";$p+$o+('-'*$_);if($_-eq$n){break};$x;$p+$c+('-'*$_)};$x}else{$o;x;$c;1..$n|%{
$y='-'*$_;$y+"8<";if($n-eq$_){break};$x;$y+"8=";$x}}
```
[Try it online!](https://tio.run/##VY9dCsIwEITfPUUJK7XWFhWE0hgvolJiWX8wprFRVGLPHrctKD7tsjP7DWOqB9b2iEp5D1qArA92Pd1yqATLloxDSVMwvr/r8naqdPB0ViGaIJ0vGn7aj0AnCqeRo@f1Rd6O2zyXO0vnqGOssp4h2mlEGIRj0LTFUHF4dkvJZ2kK@j10ZACT1GiULJFtLLAJY705HoUJvRZRl1kkeKUEt6tRnpsv6GtqTw0qi45iSPxFDOAlehOHV9xV7EsQsPgDtioVJ1DjvV98AA "PowerShell – Try It Online")
[Answer]
# [Clean](https://clean.cs.ru.nl), 294 bytes
```
import StdEnv,System.Time,ArgEnv,System._Unsafe
Start#n=toInt(select(getCommandLine)1)
=[?k l\\k<-[1..]&l<-if(n==0)(flatten o$5)(init)[$(abs n+2)'\b'++if(n<0)(rjustify(abs n+2))reverse[c,'8': $i'-']\\i<-[0..abs n],c<-[if(n<0)'>''<','=']]]
?t#(Clock n)=accUnsafe clock
|n>t*250=id= ?t
$ =repeatn
```
[Try it online!](https://tio.run/##TZBBa8JAEIXv@RULhm62JkEFoZSsUmwPgoeC7cmEsm4msjU7kd1REPrbu41aSm/z3nzMzBvdgsJgu/rYArPKYDD20Dlia6pf8JSuz57A5m/GQvrkdv@sj3f0qoFoTcrRACV1S6TEQwuakh3QorNWYb0yCGIsIrmZ71lblvsi24zzvLpri8w0CUo5EknTKiJA1sVTkRg0JDZxorae4XAieLnlw@GFLXrUfR49meb81xYOTuA8bHTKH/gjiw3PeFWWpl80yvMrVqW6V78j@Izzgqdc8qqqojkNkkXb6T1DIZXWt1RMX6zoC2d0P5mOpKklm1MUM@ngAIowhDD51v3dOx@ybciWq/B8RmWN9ldx@9W1fO3DNZ2zPw)
Note that this doesn't work on TIO, the link is just for presentation purposes.
Your results may vary if you have a `CLOCK_PER_TICK` constant other than `1000`, the default for x86 Windows Clean.
[Answer]
# [Python 2](https://docs.python.org/2/), 170 bytes
```
import time
n=input()
a=abs(n);s=a and n/a
for i in range([a-~a,10][a<1]):print'\n'*30+(a-i/2)*-s*' '+i/2*s*'-'+'>='[i%2]*(s<1)+'8'+'<='[i%2]*s+i/2*-s*'-';time.sleep(.25)
```
[Try it online!](https://tio.run/##NY5LCsIwFAD3PUU2kp/pJyKIbbxI7eKJVR/Y15DEhRuvHmvB3TDMYvw7PWayOePk55BYwmksyCH5VxKyAAeXKEi20QEDujKqoLjNgSFDYgHoPooezAe2TT300DWDPPqAlPiZuNrVWoDBykplouKM64XVQoZrfnK8x40dlIhdIzU/LK77u7iWZk3b31MZn@PoRWn3Mmdjvw "Python 2 – Try It Online")
[Answer]
# Ruby, 169 bytes
```
->x{i="";o=?=;(x!=0&&x.abs*2+1||10).times{|l|o=o[?=]?x>0?"8<":">8":x>0?"8=":"=8";f=?\s*(x<0&&-x-l/2||0);system"cls";puts x>0?i+o:f+o+i;i+=?-if(l).odd?&&x!=0;sleep 0.25}}
```
Pretty much self explainatory when you dig into it, atleast in my opinion.
Program has to be running on a computer with the cls command/alias.
[Try it online!](https://repl.it/@hrrs01/EnergeticConcernedAmethystsunbird) ( Had to overwrite the system() method, just for this script, due to the limitations mentioned above. )
I did try to use
```
puts `cls`, ...
```
But it just printed an invisible character, anyone know why?
[Answer]
# [Stax](https://github.com/tomtheisen/stax), ~~46~~ 41 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
üîφL↑≥ª⌡↨ÄA ¡`╢Σ·TmÄ↕=≈─Xí♫αF²M☻8]▒2±(═[3
```
[Run and debug it](https://staxlang.xyz/#p=818ced4c18f2a6f5178e4120ad60b6e4fa546d8e123df7c458a10ee046fd4d02385db132f128cd5b33&i=1%0A2%0A5%0A0%0A-2%0A-3%0A&a=1&m=2)
`|,` was included in a [recent release](https://github.com/tomtheisen/stax/releases/tag/v1.2.0), which is great for this challenge!
Uses JS `requestAnimationFrame` for pausing between snips.
Each testcase happens continuously after the other, so if you want a more clear version, [try this!](https://staxlang.xyz/#c=c%7Ca%5E5%3Fr%7Bxs0%3FY.%3C%3D%7B%27-y*%278%2Bs%2Bx%7Ca%5E%5E%28x%7Bx%3A%2B*%7DM.%3C8.%3E8R%7B%7C,%7D9*%7C%3A%22Testcase%3A+%22pxPpFFzP%22Complete%21%22P%7B%7C,%7DAJ*&i=1%0A2%0A5%0A0%0A-2%0A-3%0A&m=2).
-5 bytes from recursive. (`:R`)
## Explanation
`c|a^5?rFxs0?.<={n'-*'8+s+x|a^^(x0<{:R}M{|,}9*|:pF`
`c|a^5?` initial zero check:
 `?` if the input is truthy
`|a^`  take abs(n) and increment
 `5` otherwise push 5
`r` range 0..n-1
`F` for each value in the range,
`xs0?` **r:** if input is 0, then push 0, otherwise push loop iteration no.
`.<={...F`for each value in "<=",
`n'_*` repeat "\_" r times
`'8+` add 8 to that
`s+` add current loop iteration to that
`x|a^^` take abs(input) and increment twice
`(` pad on right to that length
`x0<{...}M` if input is less than 0
`:R` reflect the string (`<` → `>`)
`{|,}9*` delay 9 frames
`|:` output a form feed (clear screen)
`p` print the string without newline
]