FANDOM



:shift(int)

Shifts all the bits in the integer right one. This is effectively integer division by 2.

:shift(list)

Shifts all the elements in the list right one. The rightmost element in the list is discarded and the leftmost one becomes undef

:shift(string)

Shifts all the characters in the string right one. The rightmost character is dicarded, and the leftmost one becomes the space character (" ")

A second parameter can be added to determine how many shifts and in which direction they are made. The default is right one, or -1. shift(var,0) will have no effect. 1 will shift left one. 2 will shift left two times. The list continues in both directions.

ExamplesEdit

:shiftTst()
:Disp shift(16)=8
:Disp shift(17)=8
:
:{1,2,3,4}→list
:Disp shift(list,1)[1]=list[2]

This will print true three times. Every statement here is true.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.