Task 1: Arithmetic Slices You are given an array of integers. Write a script to find out all Arithmetic Slices for the given array of integers. An integer array is called arithmetic if it has at least 3 elements and the differences between any three consecutive elements are the same. Example 1 Input: @array = (1,2,3,4) Output: (1,2,3), (2,3,4), (1,2,3,4) Example 2 Input: @array = (2) Output: () as no slice found. MY NOTES: pretty easy. generate and test: generate all subarrays of len > 2 via two nested for loops. then test for all-elements-one-apart. (Actually, that's not quite what the spec said, but I noticed that too late). GUEST LANGUAGE: As a bonus, I also had a go at translating ch-1.pl into C (look in the C directory for the translation) Task 2: Seven Segment 200 Submitted by: Ryan J Thompson A seven segment display is an electronic component, usually used to display digits. The segments are labeled 'a' through 'g' as shown: a --- | | f | | b | g | --- | | e | | c | d | --- Seven Segment The encoding of each digit can thus be represented compactly as a truth table: my @truth = qw; For example, $truth[1] = "bc". The digit 1 would have segments "b" and "c" enabled. Write a program that accepts any decimal number and draws that number as a horizontal sequence of ASCII seven segment displays, similar to the following: ------- ------- ------- | | | | | | | | | | ------- | | | | | | | | | | ------- ------- ------- To qualify as a seven segment display, each segment must be drawn (or not drawn) according to your @truth table. The number "200" was of course chosen to celebrate our 200th week! MY NOTES: not quite so easy, but doable. GUEST LANGUAGE: As a bonus, I also had a go at translating ch-2.pl into C (look in the C directory for the translation)