NO WAY? NO WAY!

From Esolang
Jump to navigation Jump to search

NO WAY? NO WAY! (The name needs to be all caps.) is a programming language made by User:PKMN Trainer and is based on the Blue Spheres menu in Sonic 3&K.

Instructions

Instructions look like this:

(Instruction) (Number(sometimes missing)) \n

Numbers are written in binary, ? and 0 are substituted for NO WAY? and ! and 1 is substituted for NO WAY!. Here is a list of NO WAY? NO WAY! instructions.

Instruction Opcode Name Followed by Does
???? p Push Number in binary Pushes number to stack
???! P Pop Pops from the stack and discards
??!? + Plus Pops 2 numbers, adds them, and pushes the result
??!! - Minus Pops x and y, pushes y-x
?!?? j Jump Number in binary (n) Jumps to (n-1)th instruction. If n is missing, the address is taken from the stack
?!?! c Compare 2-bit number in binary (n) Pops x and y, pushes operation(n, x, y)
n operation(n, x, y)
00 x == y
01 x != y
10 x >= y
11 x < y
?!!? : Duplicate Duplicate top of stack
?!!! d Dequeue Dequeues and discards
!??? q Queue Pops a number and enqueues it
!??! S Stack Dequeues a number and pushes it
!?!? i Input Bit Pushes input (0 for num, 1 for char)
!?!! o Output Bit Dequeues number and outputs it (0 for num, 1 for char)
!!?? ? If Jumps to else or end if the front of queue <= 0
!!?! ; Else Pretty much a label for if
!!!? . End Ends if
!!!! h Halt Halt program

Programs

Cat

True

NO WAY! NO WAY? NO WAY! NO WAY? NO WAY!
NO WAY! NO WAY? NO WAY? NO WAY?
NO WAY! NO WAY! NO WAY? NO WAY?
NO WAY! NO WAY? NO WAY! NO WAY! NO WAY!
NO WAY! NO WAY? NO WAY! NO WAY?
NO WAY? NO WAY! NO WAY? NO WAY? NO WAY!
NO WAY! NO WAY! NO WAY! NO WAY?
NO WAY! NO WAY! NO WAY! NO WAY!

Binary

1010 1
1000
1100
  1011 1
  1010
  0100 1
1110
1111

Normalized

i 1
q
?
  o 1
  i
  j 1
.
h

Infinite loop

True

NO WAY? NO WAY! NO WAY? NO WAY? NO WAY?

Binary

0100 0

Normalized

j 0

Truth-machine

Binary

!?!?
?!!?
!???
!???
!!??
  !?!!
  !??!
  ?!?? !
!!!?
!?!!
!!!!

Computational class

Currently, the computational class for NO WAY? NO WAY! is unknown. Though it is likely to be Turing-complete.