~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to test/test_framework/fib_text.xml

  • Committer: dilshan_a
  • Date: 2008-01-23 04:54:10 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:270
Initial check in for test framework, and example problems

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<problem name = "Fibonacci numbers">
 
2
    <solution>
 
3
<![CDATA[
 
4
def fib(n):
 
5
  import numpy
 
6
  return int((numpy.matrix([[0, 1], [1, 1]], dtype='object')**(n-1))[1,1])
 
7
]]>
 
8
    </solution>
 
9
    <case name="Low n" function="fib">
 
10
        <arg value="10" />
 
11
        <function desc="Match">int</function>
 
12
    </case>
 
13
    <case name="First number" function="fib">
 
14
        <arg value="1" />
 
15
        <function desc="Match">int</function>
 
16
    </case>
 
17
    <case name="Zeroth number" function="fib">
 
18
         <file name="patch.py">
 
19
<![CDATA[
 
20
fib_zero = 0 
 
21
]]>
 
22
        </file>
 
23
        <arg value="0" />
 
24
        <function desc="Match">int</function>
 
25
    </case>
 
26
    <case name="High number" function="fib">
 
27
        <arg value="30" />
 
28
        <function desc="Match">int</function>
 
29
    </case>
 
30
    <case name="Very high number" function="fib">
 
31
        <arg value="1000" />
 
32
        <function desc="Match">int</function>
 
33
    </case>
 
34
</problem>