21 lines
328 B
C#
21 lines
328 B
C#
|
|
||
|
public class AscendingSequence : IInt32Sequence
|
||
|
{
|
||
|
public AscendingSequence(int first, int step)
|
||
|
{
|
||
|
this.next = first;
|
||
|
this.step = step;
|
||
|
}
|
||
|
|
||
|
int next;
|
||
|
int step;
|
||
|
|
||
|
public int GetNext()
|
||
|
{
|
||
|
int result = next;
|
||
|
next += step;
|
||
|
return result;
|
||
|
}
|
||
|
}
|
||
|
|