這個網誌中的熱門文章
謝孜妤java程式設計
import java.awt.*; import java.awt.geom.Line2D; import javax.swing.*; public class Options { public static void main(String[] args) { JFrame frame = new JFrame("謝孜妤Java繪製選擇權到期日損益"); Container cp = frame.getContentPane(); cp.add(new JComponent() { public void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D) g; g2.setStroke(new BasicStroke(2));//stroke中風,筆觸 g2.setFont(new Font("monospaced", Font.BOLD|Font.ITALIC , 30)); g2.setColor(Color.black); g2.drawString("買入賣權到期日損益",0,120); g2.draw(new Line2D.Float(0, 0, 100, 100)); g2.draw(new Line2D.Float(100, 100, 200, 100)); g2.drawString("買入買權到期日損益",300,120); g2.draw(new Line2D.Float(300, 100, 400, 100)); g2.draw(new Line2D.Float(400, 100, 500, 0)); g2.drawString("賣出賣權到期日損益...
謝孜妤bro code貪吃蛇python snake game
程式碼 a from tkinter import * import random GAME_WIDTH , GAME_HEIGHT , SPEED , SPACE_SIZE = 1600 , 800 , 2000 , 50 BODY_PARTS = 3 SNAKE_COLOR = "pink" FOOD_COLOR = "blue" BACKGROUND_COLOR = "gray" class Snake : def __init__ ( self ): self . body_size = BODY_PARTS self . coordinates = [] self . squares = [] for i in range ( 0 , BODY_PARTS ): self . coordinates . append ([ 0 , 0 ]) for x , y in self . coordinates : square = canvas . create_rectangle ( x , y , x + SPACE_SIZE , y + SPACE_SIZE , fill = SNAKE_COLOR , tag = "snake" ) self . squares . append ( square ) class Food : def __init__ ( self ): x = random . randint ( 0 , ( GAME_WID...
911有動手,就是往前進。
回覆刪除