AI Detox

56 readers
1 users here now

Verifiable tasks, exercises and puzzles. Non-passively consumable pieces of knowledge. Creativity-games and analogue physical tasks. Summed up: everything that gives your brain something to do without AI.

founded 6 days ago
MODERATORS
1
1
submitted 2 days ago* (last edited 2 days ago) by [email protected] to c/[email protected]
 
 

Problem 3

(*) Find the K'th element of a list. Solutions

The first element in the list is number 1. Example:

* (element-at '(a b c d e) 3)
c

Example in Haskell:

elementAt [1,2,3] 2

2

elementAt "haskell" 5

'e'

2
3
2
submitted 4 days ago* (last edited 4 days ago) by [email protected] to c/[email protected]
 
 

Problem 2

(*) Find the last-but-one (or second-last) element of a list. Solutions

(Note that the Lisp transcription of this problem is incorrect.)

Example in Haskell:

myButLast [1,2,3,4]

3

myButLast ['a'..'z']

'y'

4
1
submitted 4 days ago* (last edited 4 days ago) by [email protected] to c/[email protected]
 
 

Problem 2

(*) Find the last-but-one (or second-last) element of a list.

(Note that the Lisp transcription of this problem is incorrect.)

Example in Haskell:

myButLast [1,2,3,4]

3

myButLast ['a'..'z']

'y'

Source: https://wiki.haskell.org/index.php?title=99_questions%2F1_to_10

5
2
submitted 6 days ago* (last edited 6 days ago) by [email protected] to c/[email protected]
 
 

Problem 1

(*) Find the last element of a list. Solutions

(Note that the Lisp transcription of this problem is incorrect.)

Example in Haskell:

myLast [1,2,3,4]

4

myLast ['x','y','z']

'z'

6
1
submitted 6 days ago* (last edited 6 days ago) by [email protected] to c/[email protected]
7