-
-
AZOM
So this surely has been asked before, how to make the program touch a spot on the screen on a time basis (example: clicking bottom right of the screen every 10 seconds). If this is not clear enough, let me know. Also, this is a project I’m doing, but this is the part I am not able to figure out...
-
AZOM
Right, now, I don’t have my program, but I’m going to send it at ~5h pm.
-
AZOM
The only thing I am doing wrong is with rounding up numbers (I think it is my only problem) beau a se if 2 values that I compare are like at 0,000001 appart, they are not equal. Also, I am using cos and sin to try to find the three points. And my friend doesn’t program btw.
-
AZOM
No, we are in high school, and this is not a homework or something like that, he just like maths and wants help to “verify” his answer to a question he gets somewhere on the web.
-
AZOM
This is for my friend: can someone make a 3 points generator on the circumference of a circle that has a diameter of 2 units. And with these three x, y coordinates, look if the point (0,5:0) is in the triangle made with the three points?
-
-
AZOM
@mikael
How do I change the circle’s position (horizontally) with your code that you first gave me? -
-
-
-
AZOM
@mikael
Well thanks a lot for that but since I’m not so good, how do I get anchor.py ? I saw what is in the link, but what do I do with it? -
AZOM
Is it possible to enter a number, and that a UI loads with the amount of circle that you entered equally spaced vertically? And if yes, how?
-
AZOM
I’m searching for a way to see if the numbers in a list = the numbers in a dictionary key. EX: dictionary = {12345:6, 01928:7} list = [1, 2, 3]. And the output would be like: the list fit in the key 12345.
-
AZOM
Now, the last thing I need is to click a view programmatically.
-
AZOM
I’m not trying to do one (I’ve already done) I’m am searching for a random int (I know how to do this part xp) but when it finds a int, how do I make that it press the good view on the screen.
-
AZOM
Hi, I’m doing a code (at the end of the text) on a tic-tac-to project, I’m searching to do an AI, but I am wondering how I make my AI (at the beginning I want him to be random) that press on the « views » that I made.
Code (I don’t know why it shows without indent btw):
import ui import time import random CaseTouche = None turn = 0 matrix = [[0, 0, 0], [0, 0, 0], [0, 0, 0]] won = None class case(ui.View): def touch_ended(self, touch): global turn global CaseTouche if CaseTouche != None: CaseTouche.border_color = "black" CaseTouche = self self.border_color = "blue" x = int(self.name[0]) y = int(self.name[1]) if matrix[x][y] == 0: if turn == 0: self.background_color = "green" turn = 1 matrix[x][y] = 1 elif turn == 1: self.background_color = "red" turn = 0 matrix[x][y] = 2 won = verificationwin(matrix) if won == True: col = self.background_color elif won == False: col = "black" if won != None: sv = self.superview for v in sv.subviews: v.background_color = col won = None def verificationwin(matrix): if matrix[0][0] == matrix[0][1] == matrix[0][2] > 0: return True elif matrix[1][0] == matrix[1][1] == matrix[1][2] > 0: return True elif matrix[2][0] == matrix[2][1] == matrix[2][2] > 0: return True elif matrix[0][0] == matrix[1][0] == matrix[2][0] > 0: return True elif matrix[0][1] == matrix[1][1] == matrix[2][1] > 0: return True elif matrix[0][2] == matrix[1][2] == matrix[2][2] > 0: return True elif matrix[0][0] == matrix[1][1] == matrix[2][2] > 0: return True elif matrix[0][2] == matrix[1][1] == matrix[2][0] > 0: return True elif matrix[0][0] and matrix[0][1] and matrix[0][2] and matrix[1][0] and matrix[1][1] and matrix[1][2] and matrix[2][0] and matrix[2][1] and matrix[2][2] > 0: return False v = ui.load_view('tictactac') v.present()