wanna see what some of my lovely java my code looks like? ok, here you go:
StringList copy(int n, int m) //copies all the nth element starting at element m
{
StringList copycat = new StringList();
current = head;
int counta = 1;
boolean setup = false;
if (head != null)
{
while (current.next != null && setup == false) //sets up for next loop & makes first node
if (counta < m)
{
current = current.next;
counta++;
}
else
{
setup = true;
copycat.addLast(current.stringy);
size++;
copycat.current = head;
}
while (current.next != null)
{
int nop;
for(nop = 0; nop != n && current.next != null; nop++)
current = current.next;
if (nop == n)
copycat.addLast(current.stringy);
if (nop != n)
current.next = null;
}
}
return copycat;
}
}
it looks better when the tabs work, etc. :)