本文整理汇总了Python中corewar.core.instrset.base.BaseInstruction.__str__方法的典型用法代码示例。如果您正苦于以下问题:Python BaseInstruction.__str__方法的具体用法?Python BaseInstruction.__str__怎么用?Python BaseInstruction.__str__使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corewar.core.instrset.base.BaseInstruction
的用法示例。
在下文中一共展示了BaseInstruction.__str__方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __str__
# 需要导入模块: from corewar.core.instrset.base import BaseInstruction [as 别名]
# 或者: from corewar.core.instrset.base.BaseInstruction import __str__ [as 别名]
def __str__(self):
l_value = (self.m_arg5 << 12) + (self.m_arg4 << 8) + (self.m_arg3 << 4) + self.m_arg2
return "ll r%s, %s%s%s%s(%d) : %s" % (self.m_arg1,
Quartet(self.m_arg2),
Quartet(self.m_arg3),
Quartet(self.m_arg4),
Quartet(self.m_arg5),
l_value,
BaseInstruction.__str__(self))
示例2: __str__
# 需要导入模块: from corewar.core.instrset.base import BaseInstruction [as 别名]
# 或者: from corewar.core.instrset.base.BaseInstruction import __str__ [as 别名]
def __str__(self):
l_n = (self.m_arg3 << 4) + self.m_arg2
l_m = (self.m_arg5 << 4) + self.m_arg4
return "ldb r%s, %s%s(%d), %s%s(%d) : %s" % (self.m_arg1,
Quartet(self.m_arg2),
Quartet(self.m_arg3),
l_n,
Quartet(self.m_arg4),
Quartet(self.m_arg5),
l_m,
BaseInstruction.__str__(self))
示例3: __str__
# 需要导入模块: from corewar.core.instrset.base import BaseInstruction [as 别名]
# 或者: from corewar.core.instrset.base.BaseInstruction import __str__ [as 别名]
def __str__(self):
l_n = (self.m_arg3 << 4) + self.m_arg2
l_m = (self.m_arg5 << 4) + self.m_arg4
return "stb [r%s(%d)], %s%s(%d), %s%s(%d) : %s" % (self.m_arg1,
self.m_ship.getRegister(self.m_arg1).getValue(),
Quartet(self.m_arg2),
Quartet(self.m_arg3),
l_n,
Quartet(self.m_arg4),
Quartet(self.m_arg5),
l_m,
BaseInstruction.__str__(self))
示例4: __str__
# 需要导入模块: from corewar.core.instrset.base import BaseInstruction [as 别名]
# 或者: from corewar.core.instrset.base.BaseInstruction import __str__ [as 别名]
def __str__(self):
return "add r%s(%d) r%s(%d) : %s" % (self.m_arg1,
self.m_ship.getRegister(self.m_arg1).getValue(),
self.m_arg2,
self.m_ship.getRegister(self.m_arg2).getValue(),
BaseInstruction.__str__(self))
示例5: __str__
# 需要导入模块: from corewar.core.instrset.base import BaseInstruction [as 别名]
# 或者: from corewar.core.instrset.base.BaseInstruction import __str__ [as 别名]
def __str__(self):
return "mode %s : %s" % (self.idxToMode(self.m_arg1).Name,
BaseInstruction.__str__(self))
示例6: __str__
# 需要导入模块: from corewar.core.instrset.base import BaseInstruction [as 别名]
# 或者: from corewar.core.instrset.base.BaseInstruction import __str__ [as 别名]
def __str__(self):
l_value = (self.m_arg3 << 4) + self.m_arg2
return "lc r%s %d : %s" % (self.m_arg1,
l_value,
BaseInstruction.__str__(self))
示例7: __str__
# 需要导入模块: from corewar.core.instrset.base import BaseInstruction [as 别名]
# 或者: from corewar.core.instrset.base.BaseInstruction import __str__ [as 别名]
def __str__(self):
return "nop : %s" % (BaseInstruction.__str__(self))
示例8: __str__
# 需要导入模块: from corewar.core.instrset.base import BaseInstruction [as 别名]
# 或者: from corewar.core.instrset.base.BaseInstruction import __str__ [as 别名]
def __str__(self):
return "crash : %s" % BaseInstruction.__str__(self)
示例9: __str__
# 需要导入模块: from corewar.core.instrset.base import BaseInstruction [as 别名]
# 或者: from corewar.core.instrset.base.BaseInstruction import __str__ [as 别名]
def __str__(self):
return "check : %s" % (BaseInstruction.__str__(self))
示例10: __str__
# 需要导入模块: from corewar.core.instrset.base import BaseInstruction [as 别名]
# 或者: from corewar.core.instrset.base.BaseInstruction import __str__ [as 别名]
def __str__(self):
return "stat r%s %d : %s" % (self.m_arg1,
self.m_arg2,
BaseInstruction.__str__(self))
示例11: __str__
# 需要导入模块: from corewar.core.instrset.base import BaseInstruction [as 别名]
# 或者: from corewar.core.instrset.base.BaseInstruction import __str__ [as 别名]
def __str__(self):
return "rol r%s(%d) %d : %s" % (self.m_arg1,
self.m_ship.getRegister(self.m_arg1).getValue(),
self.m_arg2,
BaseInstruction.__str__(self))