Menu

#98 e) and e( (array max and min) implementation (code snippet)

0.6.5
duplicate
aditsu
None
2016-01-30
2016-01-24
UsernameAK
No

Please add this code, this implements some of your planned features.

       add(new Op1("e)") {
            @Override
            protected Object calc(final CJam x, final Object a) {
                if (!isList(a)) {
                    throw fail(a);
                }
                final List<?> l = toList(a);
                return Collections.max(l);
            }
        });
        add(new Op1("e(") {
            @Override
            protected Object calc(final CJam x, final Object a) {
                if (!isList(a)) {
                    throw fail(a);
                }
                final List<?> l = toList(a);
                return Collections.min(l);
            }
        });

Discussion

  • aditsu

    aditsu - 2016-01-30
    • status: open --> duplicate
     
  • aditsu

    aditsu - 2016-01-30

    Duplicate of ticket [#97]

     

    Related

    Tickets: #97


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.