Some fun Code Golf Challenges

Hello everyone! I decided to put together some fun code golf challenges. For those of you who don't know, code golf is trying to make the smallest program the completes a given task.

Current Scoring:

  • All blocks=1 point
  • All inputs=1 point
  • All constants=1 point
  • Inputs given to the program=0 points

Some rules:

  • No javascript functions
  • Custom blocks are allowed, but all blocks inside them will be counted as well

Post you answers as a picture below and if they have a smaller score than other submissions, I will add them in this post.
If you any questions, comments, or suggestions, speak up and ask.

So without further ado, let's get coding!

Day 1-Warm-Up:

Challenge 1:
Recreate the untitled%20script%20pic%20(1) block without using the block itself. You script should take a list "input list" and a value "input value" and report < true > if "input list" contains "input value" and false otherwise.

The current smallest script is by: @dardoro with a score of: 6


Challenge 2:
Recreate the untitled%20script%20pic%20(1) block without using the block itself. It should take a list "input list" as input and report the length of "input list".

The current smallest script is by: @snapenilk with a score of: 5


Challenge 3:
Recreate the untitled%20script%20pic%20(2) block without using the block itself. It should take a number "input number" as input and report the floor of "input number". That is, it should report the greatest integer less than or equal to "input number".

The current smallest script is by: @dardoro with a score of: 4


More, harder challenges coming soon!

Challenge 1:REVOKED wrong result "list() contains false". Should report false not trueuntitled%20script%20pic%20(4)
Challenge 2:untitled%20script%20pic%20(2)
Challenge 3: untitled%20script%20pic%20(3)

Wow, I learned something from both the challenges and answers. Especially I like your recursive answer to Challenge 2, @dardoro

I have a question which is not really about the contents of challenge. So, I made a list consisting of indices and words (taken from the introduction written by legoman3.14, above) and then I tried to get some N-grams to find the words "Post you" in them, but I'd need some help because I don't know how to filter the Merged_occurencies list, keeping only those items so that their indices are apart from each other only 1. Well, see the screen-capture below.

The Indices&Words list has been created by the script below:

First you need to sort the merged occurrences list:
untitled%20script%20pic%20(3)
(The sort block is the list utilities library)
Then you need to keep items such that the item you are currently looking at equals the first word of the n-gram (n), and the next item (n+1) is the same as the second term.
untitled%20script%20pic%20(4)
This will result in only keeping the first item of the bi-gram, so you add an or statement to keep items such that the current item (n) equals the second search term, and the item before it (n-1) equals the first search term.
untitled%20script%20pic%20(5)
Hope this helps! If you have any question, just ask (I am not the best at explaining things).

It does help. Thank you.

@legoman3.14 Challenge 2: image

Length of the empty list is null ???

Well, for your challenge 1 submission, what if the list doesn't contain false but you test if it does?

Maybe put a ([0] in front of []) with the map block.

There is a test case project. Every expression evaluates to true.

I not fully understand "what if the list doesn't contain false but you test if it does?" What expression should i test?

Golf%20Challenge%20script%20pic%20(1)

I meant the Boolean false, not the String "false".

The find first item reporter reports the false Boolean if the item is not found in the list.

Yes wrong result "list() contains false". Should report false not true

Updated test cases:

Update challenge 1:
Golf%20Challenge%20script%20pic%20(1)