當前位置:首頁 » 編程軟體 » 花的編程代碼

花的編程代碼

發布時間: 2023-08-03 14:00:33

❶ 求一個數控電火花線切割編程代碼,全篇都是G開頭的那種,謝謝了,簡單點8條線以上就可以了,要有圓弧和

我這有數控切割機用的程序,好像跟線切割的差不多,給你參考一下。
G00 快速定位
G01 直線加工
G02 順圓加工
G03 逆圓加工

G41 向左補償 割縫
G42 向右補償 割縫

G90 絕對坐標
G91 增量坐標
G92 加工坐標系原點設置指令

M02 程序結束
M07 切割開始(點火、預熱、切割氧開,割槍升降)
M08 切割結束(切割氧等關閉,割槍升)

示例 用TXT格式

G92X0Y0 設置參考點
G21 設置為公制編程
G91 設置為增量坐標
G00 X10 Y10 快速行走 X=10 Y=10
G41 左補償
M07 切割開始(點火、預熱、切割氧開,割槍升降)
G01 X0 Y50 直線行走 X=0 Y=50
G02 X100 Y0 I50 J0 順圓弧 (半徑為50的半圓弧)
I(等於圓心的X坐標值減去起點的X坐標值)
J(等於圓心的Y坐標值減去起點的Y坐標值)

G01 X0 Y-50 X(等於終點的X坐標值減去起點的X坐標值)

G01 X-100 Y0 Y(等於終點的Y坐標值減去起點的Y坐標值)

M8 切割結束(切割氧等關閉,割槍升)
G40 補償關閉
M02 程序結束
以上資料由方君焊割提供。

❷ 用vb求1到1000水仙花數的編程方法

所謂的水仙花數(梅花數)是指在三位整數(100到999之間)中,百位數、十位數、個位數的立方和等於它本身,如153=1^3+5^3+3^3。
程序代碼如下:
Private Sub Command1_Click()
Dim i As Integer, s As Integer
Dim a As Integer, b As Integer, c As Integer
Print "100到999所有水仙花數(也叫梅花數):";
For i = 100 To 999
a = i \ 100 '取百位數
b = i \10 Mod 10 '或 b = i Mod 100 \10 取十位數
c = i Mod 10 『取個位數
s = a ^ 3 + b ^ 3 + c ^ 3 '水仙花數的判斷依據
If s = i Then
Print i;
End If
Next i
End Sub

運行結果:
100到999所有水仙花數(也叫梅花數): 153 370 371 407

❸ 在桌面上顯示很多玫瑰花的一個vb小程序代碼

桌面塗鴉VB程序代碼
Option Explicit
Public Type POINTAPI
x As Long
y As Long
End Type
Public nXn As Long
Public gfqw As Long
Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Public sbsb As POINTAPI
Public Declare Function SetWindowsHookEx Lib "user32" Alias "SetWindowsHookExA" (ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As Long, ByVal dwThreadId As Long) As Long
Public Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As Long
Public Declare Function CallNextHookEx Lib "user32" (ByVal hHook As Long, ByVal nCode As Long, ByVal wParam As Long, lparam As Any) As Long
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (lpvDest As Any, ByVal lpvSource As Long, ByVal cbCopy As Long)
Public Declare Function MessageBox Lib "user32" Alias "MessageBoxA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long
Public Type MOUSEMSGS
x As Long 'x座標
y As Long 'y座標
a As Long
b As Long
time As Long 'Window運行時間
End Type
Public Const WH_MOUSE_LL = 14
Public Const MB_OK = &H0&
Public Const MB_ICONASTERISK = &H40&
Public Type MSLLHOOKSTRUCT
pt As POINTAPI
mouseData As Long
Flags As Long
time As Long
dwExtraInfo As Long
End Type
Public hHook As Long
'-----------------------------------------
'消息
Public Const HC_ACTION = 0
Public Const HC_SYSMODALOFF = 5
Public Const HC_SYSMODALON = 4
'滑鼠消息
Public Const WM_MOUSEMOVE = &H200
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_LBUTTONUP = &H202
Public Const WM_LBUTTONDBLCLK = &H203
Public Const WM_RBUTTONDOWN = &H204
Public Const WM_RBUTTONUP = &H205
Public Const WM_RBUTTONDBLCLK = &H206
Public Const WM_MBUTTONDOWN = &H207
Public Const WM_MBUTTONUP = &H208
Public Const WM_MBUTTONDBLCLK = &H209
Public Const WM_MOUSEACTIVATE = &H21
Public Const WM_MOUSEFIRST = &H200
Public Const WM_MOUSELAST = &H209
Public Const WM_MOUSEWHEEL = &H20A
Public Declare Function GetActiveWindow Lib "user32" () As Long
Public MouseMsg As MOUSEMSGS '滑鼠消息結構體
Public lHook As Long '勾子句柄
Public sbss As POINTAPI
'滑鼠鉤子函數
Public Function HookProc(ByVal nCode As Long, ByVal wParam As Long, ByVal lparam As Long) As Long
Dim typMHS As MSLLHOOKSTRUCT, pt As POINTAPI
If wParam = WM_MOUSEMOVE Then
Call CopyMemory(typMHS, ByVal lparam, LenB(typMHS))
pt = typMHS.pt
Debug.Print "mouse Cursor at " + CStr(pt.x) + "," + CStr(pt.y)
GetCursorPos sbsb
End If
If wParam = WM_LBUTTONDOWN Then
Form1.Timer2.Enabled = True
nXn = 2
GetCursorPos sbss
End If
If wParam = WM_RBUTTONDOWN Then
End If
If wParam = WM_LBUTTONUP Then '按下中間記下這個值,然後調用一個過程,我的滑鼠沒有中鍵,自己測試一下
Form1.Timer2.Enabled = False
HookProc = CallNextHookEx(hHook, nCode, wParam, lparam)
End If
End Function

'卸載勾子
Public Sub StopHook()
If lHook <> 0 Then lHook = UnhookWindowsHookEx(lHook)
End Sub

'===================== 模塊結束 ========================
Public Sub FreeHook()
If hHook <> 0 Then
Call UnhookWindowsHookEx(hHook)
hHook = 0
End If
End Sub

Public Sub EnableHook()
If hHook = 0 Then
hHook = SetWindowsHookEx(WH_MOUSE_LL, AddressOf HookProc, App.hInstance, 0)
End If
End Sub

❹ mind+編程五瓣花怎麼做

以下兩種做法:
1、mind是一款導圖軟體,軟體中的鋼筆工具可以編程五瓣花。
2、可以使用mind中的基本模型工具,基本模型工具中有五瓣花的基本編程。

c語言編寫程序 水仙花數 玫瑰花數

1
#include <stdio.h>
#include <stdlib.h>
int flower(int n)
{
int i, j, k;
i = n % 10;
j = n / 10 % 10;
k = n / 100;
if (i*i*i + j*j*j + k*k*k == n)
return 1;
else
return 0;
}
int main(void)
{
int i;
for (i = 100; i < 1000; i++)
{
if (flower(i) == 1)
printf("%d ", i);
}
return 0;
}
2.
#include <stdio.h>
#include <stdlib.h>
int rose(int n)
{
int i, j, k,m;
i = n % 10;
j = n / 10 % 10;
k = n / 100%10;
m = n / 1000;
if (i*i*i*i + j*j*j*j + k*k*k*k+m*m*m*m == n)
return 1;
else
return 0;
}
int main(void)
{
int i;
for (i = 1000; i < 10000; i++)
{
if (rose(i) == 1)
printf("%d ", i);
}
return 0;
}

❻ 編程題(玫瑰花數)

java">//java程序
for(inti=1000;i<10000;i++){
inta=i/1000;
intb=(i-a*1000)/100;
intc=(i-a*1000-b*100)/10;
intd=i-i/10*10;
if(i==Math.pow(a,4)+Math.pow(b,4)+Math.pow(c,4)
+Math.pow(d,4)){

System.out.println(""+a+b+c+d);
}
}

希望能幫上其他小夥伴

❼ c語言玫瑰花代碼

C語言玫瑰花具體代碼如下。
玫瑰花數又稱「四葉玫瑰數」,是指四位數各位上的數升行字的四次方之和等於本吵冊嘩身的數,c語言玫瑰花代碼是【intmain()inti,j,t;for(i=1000;i<10000;i++){...}】。玫瑰花數又稱「四葉玫瑰數」,是指四位數各位上的數字的四次方之和等於本身的數。例如:1634就是一個玫瑰花姿指數1*1*1*1=16*6*6*6=12963*3*3*3=814*4*4*4=2561+1296+81+256=1634

❽ c語言編程煙花代碼簡單

c語言編程煙花代碼簡單如下:

#include "stdlib.h"

#include "graphics.h"

#include "stdio.h"

#include "math.h"

#include "conio.h "

#define PI 3.1425926

main()

{

int gdriver=DETECT,gmode,errorcode;

int a[10],b[10],x,y,c,r,i,j,t;

double rad = 0.0;

/* initialize graphics and local variables */

initgraph(&gdriver , &gmode ,"");

/* read result of initialization */

errorcode = graphresult();

if (errorcode != grOk) /* an error occurred */

{

printf("Graphics error : %s/n",grapherrormsg(errorcode));

printf("Please any key to halt:");

getch();

exit(1); /* terminate with an error code */

}

randomize();

for(;!kbhit();)

{

x=rand()%500+100; /*隨機中心坐標州純*/

y=rand()%300+100;

for(r = 0 ;r <= 8 ; r++ ) /*煙花的大小設定*/

{

for(i = 0,rad = 0.0 ; rad < 2*PI; rad += 0.78 ) /*設定坐標*/

{

a[i++] = x + (int)r *10* cos(rad);

b[ i ] = y + (int)r *10* sin(rad);

}

t = i;

for(i=1;i<t;i++)

{

c=rand()%13+1; /*各點的顏色隨機*/

setcolor(c); /*功能:將當前圖形屏幕的當前筆畫顏色置為color.*/

circle(a[i],b[i],1);/* a[i],b[i] 為圓心 1 為半徑 畫圓 */

}

delay(10000);

delay(10000);

cleardevice();

函數名: cleardevice

功 能: 清除圖形屏幕

用 法: void far cleardevice(void);

}

}

getch();

closegraph();

函數名: closegraph

功 能: 關閉圖形系統

用 法: void far closegraph(void);

}

初始化煙花參數

void Init( int i )

{

// 分別為:煙花余族中心到圖片邊緣的最遠距離、煙花中心到圖片左上角的距離 (x、y) 兩個分量

int r[13] = { 120, 120, 155, 123, 130, 147, 138, 138, 130, 135, 140, 132, 155 };

int x[13] = { 120, 120, 110, 117, 110, 93, 102, 102, 110, 105, 100, 108, 110 };

int y[13] = { 120, 120, 85, 118, 120, 103, 105, 110, 110, 120, 120, 104, 85 };

/**** 初始化煙花 *****/

Fire[i].x = 0; // 煙花中心坐標

Fire[i].y = 0;

Fire[i].width = 240; // 圖片寬

Fire[i].height = 240; // 圖片高

Fire[i].max_r = r[i]; // 最大半徑

Fire[i].cen_x = x[i]; // 中心距左上角距離

Fire[i].cen_y = y[i];

Fire[i].show = false; // 是否綻放

Fire[i].dt = 5; // 綻放時間間隔

Fire[i].t1 = timeGetTime();

Fire[i].r = 0; // 從 0 開始綻放

/**** 初始化煙花彈 *****/

Jet[i].x = -240; // 煙花彈左上角坐標

Jet[i].y = -240;

Jet[i].hx = -240; // 煙花彈豎跡弊發射最高點坐標

Jet[i].hy = -240;

Jet[i].height = 0; // 發射高度

Jet[i].t1 = timeGetTime();

Jet[i].dt = rand() % 10; // 發射速度時間間隔

Jet[i].n = 0; // 煙花彈閃爍圖片下標

Jet[i].shoot = false; // 是否發射

}

熱點內容
編程老爺爺 發布:2025-02-05 16:48:20 瀏覽:126
支持ftp的免費空間 發布:2025-02-05 16:32:00 瀏覽:889
python時間比較 發布:2025-02-05 16:31:46 瀏覽:50
手機銀行的密碼怎麼改密碼忘了怎麼辦啊 發布:2025-02-05 16:02:02 瀏覽:179
演算法牛人左 發布:2025-02-05 15:31:02 瀏覽:439
php篩選功能 發布:2025-02-05 15:29:09 瀏覽:168
ip匹配伺服器 發布:2025-02-05 15:10:35 瀏覽:909
php語法後 發布:2025-02-05 15:10:34 瀏覽:59
oppor9s怎麼壓縮文件 發布:2025-02-05 15:00:34 瀏覽:639
蘋果耳塞怎麼改安卓也能用 發布:2025-02-05 14:50:54 瀏覽:558