- #1
6.28318531
- 54
- 0
Homework Statement
Given a list of integers, use pattern matching and //.to create a rule that generates an ordered list of integers that are larger than the previous numbers in the list, eg given {3,5,2,0,6,1,8,4,9}, you should get {3,5,6,8,9}
Homework Equations
The Attempt at a Solution
Well calling our arbitrary list L, I tried
rules={___,x_,y_,___}/;x>y :→{___,x,___}; then
L //. rules . From this I just get {5}?
I haven't used pattern matching alot, so what else am I meant to do?