Skip to content

IFS in coconut #727

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 11, 2020
Merged

IFS in coconut #727

merged 6 commits into from
Jul 11, 2020

Conversation

Amaras
Copy link
Member

@Amaras Amaras commented Jul 5, 2020

This code is apparently not working, for a reason that is unknown to me.
Whenever I try to run it (coconut -r --no-tco IFS.coco), I get this traceback or similar:

  File "/usr/lib/python3.8/runpy.py", line 263, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "/usr/lib/python3.8/runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.8/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/amaras/algorithm-archive/contents/IFS/code/coconut/IFS.py", line 788, in <module>
    for point in chaos_game(10000, shape_points):
  File "/home/amaras/algorithm-archive/contents/IFS/code/coconut/IFS.py", line 776, in chaos_game
    p = (1 / 2) * (p + choice(shape_points))
  File "/home/amaras/algorithm-archive/contents/IFS/code/coconut/IFS.py", line 767, in __add__
    return point(self.x + other.x, self.y + other.y)
TypeError: 'point' object is not callable

I would appreciate any help I can get

@berquist berquist added the Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.) label Jul 5, 2020
from math import sqrt
from random import random, choice

data point(x=0, y=0):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hint: it has to do with point here...

point(0.5, sqrt(0.75)),
point(1.0, 0.0)]
with open("sierpinski.dat", "w") as f:
for point in chaos_game(10000, shape_points):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...and point here.

@Amaras Amaras changed the title WIP: IFS in coconut IFS in coconut Jul 7, 2020
@Amaras Amaras marked this pull request as ready for review July 7, 2020 19:46
@berquist berquist merged commit f0b388f into algorithm-archivists:master Jul 11, 2020
@Amaras Amaras deleted the ifs_in_coconut branch July 11, 2020 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants