Solve the Module Without Help
Overview:
In order to complete this module, you will have to write three functions:
verify_slopes
, which has two parametersslopes_arr
andslopes_len
and returns onefelt
is_valid
which is 1 if true or 0 if false. What makes a pyramid valid? If an array of slopes of the sides of a pyramid are all in the range of [51, 52] then the pyramid is valid and up to the mummies' architectural standards. (The great pyramid at Giza has all of its sides exactly at 51.5 degrees).double_verify_slopes
, which has four parameters -first_arr
,first_arr_len
,second_arr
,second_arr_len
- and returns onefelt
res
. It will run theverify_slopes
method once on the first array and then once on the second array, returning 1 if both the pyramids are valid and 0 otherwise.is_silly_pyramid
, which has two parametersslopes_arr
andslopes_len
and returns twofelts
is_negative_pyramid
andis_never_ending_pyramid
, each of which is 1 if true or 0 if false. What makes a negative pyramid? Each of the slopes of the sides of the pyramid must be in the range [-89, -1], this would make a pyramid that closes and is upside down. What makes a never ending pyramid? Each of the slopes of the sides of the pyramid must be in the range [90, 179], as this would make the walls of the pyramid extend to the heavens forever.
Your turn:
Your goal is to make the script compile and run successfully. Good luck! If you understand what a local
variable is, you can use it in your functions, but try to achieve this just using let
to build your craftiness in Cairo.
References:
For official Cairo Docs: $ https://www.cairo-lang.org/docs/$