예제 #1
0
파일: matrix.py 프로젝트: xou/hardcaptcha
    def getCaptcha(self):
        vecA = matrices.randMatrix(self.dim, 1, min=0, max=5)
        vecB = matrices.randMatrix(1, self.dim, min=0, max=5)

        symbolic = vecA * vecB
        crnum = random.choice(range(0, self.dim))
        
        result = symbolic[:,crnum]
        symbolic[:,crnum] = sympy.symbols(['a','b','c'])
        
        return (VecMulChallenge(vecA, vecB, symbolic, desc="Enter the missing column"),
                VectorResponse(result))
예제 #2
0
파일: matrix.py 프로젝트: xou/hardcaptcha
 def getCaptcha(self):
     matrix = matrices.randMatrix(self.dim, self.dim, min=-3, max=3)
     result = matrix.det()
     return (DetMatrixChallenge(matrix), IntegerResponse(result))