• Matteo

    @cvp Yes, in this way it works! Thank you @cvp.

    @jmv38 and @mkeywood : can the script recognize also the same picture drew in different positions inside the three squares? I tried it but maybe I'm wrong with something because it doesn't work, I mean if I draw the same picture in different positions, I can't obtain the good choice of the picture inside the guess square.

    Thank you
    Regards

    posted in Pythonista read more
  • Matteo

    @cvp Hi, sorry but it doesn't work with me , the reason could be I use Pythonista 3.1 (301016)?
    When I draw something on a square, leave my finger from the screen, try to draw something else on the same square by touching again the screen on the square, and leave my finger from the screen , the old draw remains, it doesn't disappear to show anly the new one.

    But don't worry, it is not so important, the script works well now.
    Thank you
    Bye

    posted in Pythonista read more
  • Matteo

    Hi @jmv38 , I'm sorry for the delay, I've been busy and never used Pythonista for one week..Now I tested something and solved the problem related to integer argument expected of version 14 by adding int(argument) where needed in your code and since I use python 2.7 by default, I forgot to put the command #!python3 on the first line of the script (without it I had another problem with python 2.7). Now all work well!

    For request 2 about erasing only one draw, I can't understand, sorry: if I try to draw something else on the square the old draw remains. Am I wrong?

    Anyway thank you again (also @cvp) for support.
    Regards

    posted in Pythonista read more
  • Matteo

    Hi @cvp, wondeful, it works perfectly! Very exciting! Now I can use the jmv38 code also in my little phone :-)

    Unfortunately when I touch button 1/ Train after adding the draws the code tells me "Type Error: integer argument expected, got float".

    I will perform some tests and if needed I will post here the full traceback.

    Thank you again
    Regards

    posted in Pythonista read more
  • Matteo

    @jmv38 Hi, very interesting, congratulations and thank you for your explanations!

    Unfortunately I can't use your script due to little screen of my 5s (no, I haven't an iPad).

    I'd like to ask you some things, if you are interested and have time:

    1. would it be too difficult for you to modify your script in order to allow user to swipe/move with fingers the full graphical panel of your script in little idevices to be able to see and access the full sub graphical views ("Prepare the data", "Train the model", etc...)? I think that by using the powerful scripts written by @mikael it could be possible, but really I don't know how.
    2. could you think a good proposal to add a "delete" button for each single square in order to delete draw inside only one square, instead of to delete all by touching the Reset!! key?
    3. in my opinion it would be nice to implement (but I repeat only if you are interested and have time) a way to have a grid (with adjustable dimensions) for when user draws very simple things on squares, only to test the algorithm also with simple draws like for example 2x3 big pixels images.

    Thank you
    Regards

    posted in Pythonista read more
  • Matteo

    @jmv38 Oops, you are right , my mistake, sorry @mkeywood :-), I didn't read the whole thread...

    Anyway thank you for the answer. Some times ago I started for fun to study something about ML, and the first test example in my mind was an algorithm able to learn how to play a simple game like tictactoe, without studying any python specific library for ML.

    The interesting thing in my opinion is how to create a general algorithm able to learn something without any big python libraries, only as a concept proof and with some little constraints defined by user for the research of the Ml goal/goals. The constraints could change in the algorithm when some situations occur during calculation. So thank you again both for your work, maybe it could give me some technical info for the ML game solver I've in mind.

    Regards

    posted in Pythonista read more
  • Matteo

    @cvp thank you for explanation, unfortunately I have not familiarity with words like "attribute" and "method" (object-oriented programming). Anyway your code works so it is enough for me :-)
    Bye

    posted in Pythonista read more
  • Matteo

    @jmv38 Hi interesting project! I'd like to ask you two things about it:

    1. could you easly modify your script in order to allow execution also on little screens (4 in)? Does anyone here (Pythonista forum) know a general way to modify easly a script with UI in order to adapt it automatically according to screen size (through the automatic recognition of the screen size of the device where the script is executed)?
    2. only for fun, if you are interested: how about a script (by following your original script) that tries to learn to play tic-tac-toe game? For example with random choice of moves at beginning and positive weight to set of moves for winner player in several matches, in order to create a set of moves (getting closer to being the best ones) for each situation? What would you suggest?

    Thank you and feel free to share some reasoning about it.
    Regards

    posted in Pythonista read more
  • Matteo

    Thank you @cvp , I think console.text() should be GetConsoleText(), based on your previous post. Am I right? And I can't understand console.setText_: what is it?
    Bye

    posted in Pythonista read more
  • Matteo

    Hi @cvp, WOW, I am always fascinated when some people (like you) can write certain codes, here I feel like a child in a toy store! This forum is really full of creative people!

    Sorry for delay of my response, your first script works very well, I was trying to understand it (without much success), I added it in @JonB StatusBarMenu as an action (I use this version, slightly modified, on my old little iPhone 5s with Pythonista version 3.1 - 301016, yes I still use that version ;-) ), but it is really too advanced for me, it is enough for me it works very well.

    Then I tried your second script and I didn't think such that thing was possible: that is the customization of the input field in console environment!

    Now (after some dive in objc) it is possible to process with one single touch each console input.

    My next step is to understand how to recover functions, definitions and global variables like numbers, strings, arrays, etc... created in built-in Pythonista interpreter in order to pass them in the string in console as arguments of any function that must be executed by a remote interpreter (for example when the function is not available in Pythonista, I use a lot Scipy for example).

    Many thanks for your help!
    Regards

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!