當前位置: 首頁>>代碼示例>>Python>>正文


Python BaseInstruction.__str__方法代碼示例

本文整理匯總了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))
開發者ID:psycofdj,項目名稱:corewar,代碼行數:11,代碼來源:ll.py

示例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))
開發者ID:psycofdj,項目名稱:corewar,代碼行數:13,代碼來源:ldb.py

示例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))
開發者ID:psycofdj,項目名稱:corewar,代碼行數:14,代碼來源:stb.py

示例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))
開發者ID:psycofdj,項目名稱:corewar,代碼行數:8,代碼來源:add.py

示例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))
開發者ID:psycofdj,項目名稱:corewar,代碼行數:5,代碼來源:mode.py

示例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))
開發者ID:psycofdj,項目名稱:corewar,代碼行數:7,代碼來源:lc.py

示例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))
開發者ID:psycofdj,項目名稱:corewar,代碼行數:4,代碼來源:nop.py

示例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)
開發者ID:psycofdj,項目名稱:corewar,代碼行數:4,代碼來源:crash.py

示例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))
開發者ID:psycofdj,項目名稱:corewar,代碼行數:4,代碼來源:check.py

示例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))
開發者ID:psycofdj,項目名稱:corewar,代碼行數:6,代碼來源:stat.py

示例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))
開發者ID:psycofdj,項目名稱:corewar,代碼行數:7,代碼來源:rol.py


注:本文中的corewar.core.instrset.base.BaseInstruction.__str__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。