Code: Select all
Macro NextCElement(alpha)
If Not NextElement(alpha)
FirstElement(alpha)
EndIf
EndMacro
Macro PreviousCElement(alpha)
If Not PreviousElement(alpha)
LastElement(alpha)
EndIf
EndMacro
Code: Select all
Macro NextCElement(alpha)
If Not NextElement(alpha)
FirstElement(alpha)
EndIf
EndMacro
Macro PreviousCElement(alpha)
If Not PreviousElement(alpha)
LastElement(alpha)
EndIf
EndMacro
I like the idle bots best.idle wrote:I am a bot. Nanu nanu
Not only : a CPU time is required to execute this. Pipe-line is temporarly shut down, and several statements which used 0 or 1 cycles will use 10 cycles or more.idle wrote:The memory fence [...] only stops [...]
Code: Select all
Structure pif
a.a[0]
EndStructure
*ll.pif = allocatememory(1000)
procedure insert(*this.pif, i, pif)
with *this
for a = 1000 to i+1 step -1
\a[a] = \a[a - 1]
next
\a[i] = pif
endwith
endprocedure
Code: Select all
void insertt(int val, int pos) {
if (pos < 0) return;
if (pos > sz + 1) return;
sz += 1;
for (int i = sz; i > pos; i--)
a[i] = a[i - 1];
a[pos] = val;
}