[UG\ X secondary development] NXOpen point-to-point moving face (admMoveFaceBuilder), point-to-point copying face (copyFaceBuilder)

//Move the surface from point to point tag_t P2P_move_face(std::vector<tag_t> faces, double pt1[3], double pt2[3]) { if (faces.empty()) { return false; } Session *theSession = Session::GetSession(); Part *workPart(theSession->Parts()->Work()); Part *displayPart(theSession->Parts()->Display()); Features::AdmMoveFace *nullFeatures_AdmMoveFace(NULL); if (!workPart->Preferences()->Modeling()->GetHistoryMode()) { throw NXException::Create(“Create or edit of a Feature was recorded in History Mode but playback is in History-Free Mode.”); } Features::AdmMoveFaceBuilder *admMoveFaceBuilder1; […]

Rust2 Common Programming Concepts & Understanding Ownership

Rust study notes Rust Programming Language Introduction Tutorial Course Notes Reference textbook: The Rust Programming Language (by Steve Klabnik and Carol Nichols, with contributions from the Rust Community) Lecture 3 Common Programming Concepts fn main() {<!– –> // Variables and Mutability let mut x = 5; // mut means mutable println!(“The value of x is: […]

Make a simple backgammon game based on React

Today I am learning React and read the official documentation. There is an example of the Jiugongge game. I want to write a case of backgammon myself. Let’s look at the effect first: (X and O represent black and white respectively) The main function: 1. Click on the chessboard position to render the black and […]

Lambda lambda expression algorithm problem immortal rabbit monkey eating peach climbing stairs

Directory Lambda lambda expression standard format Summarize Lambda advanced omission writing method practise Algorithm questions Immortal Rabbit Monkey eats peach Climb stairs Lambda The most intuitive effect is to simplify the writing of anonymous inner classes as above public static void main(String[] args) {<!– –> Integer arr[]={<!– –>2,1,4,6,3,5,8,7,9}; Arrays.sort(arr, (Integer o1, Integer o2)-> {<!– –> […]

vue2+ant-design-vue a-form-model component secondary encapsulation (form form component) FormModel form

1. Renderings 2. Parameter configuration 1. Code example <t-antd-form :ref-obj.sync=”formOpts.ref” :formOpts=”formOpts” :widthSize=”1″ :labelCol=”{ span:2}” :wrapperCol=”{ span:22}” @handleEvent=”handleEvent” /> 2. Configuration parameters inherit all properties of FormModel Parameter Description Type Default value refObj form form validation rule method (you can refer to validate in the antd FormModel form method) obj – className Custom class name String […]

C language implements backgammon (single player, networked double player, human-computer, regret game, replay, prompt)

I would like to share with you my previous big homework in C language. When I have time, I will break it down and write a detailed note. #undef UNICODE #undef _UNICODE #include <stdio.h> #include <WinSock2.h> #include <WS2tcpip.h> #pragma comment(lib,”ws2_32.lib”) #include <windows.h> #include<mmsystem.h> #include<graphics.h> #pragma comment(lib,”Winmm.lib”) IMAGE bgp; MOUSEMSG m; int n_x = 0, n_y […]

Socket comparison of unity backgammon simple online server python, Java and c# languages

Python side code: import socket from threading import Thread import time importsys #Create storage object class Node: def __init__(self): self.Name = None # Username self.Thr = None # Socket connection object class TcpServer: user_name = {} # Store user information; dict username: Node object def __init__(self, port): “”” Initialize server object port: server port “”” […]

Unity backgammon simple online client

Unity client code: using System; using System.Collections; using System.Net.Sockets; using System.Text; using UnityEngine; using UnityEngine.UI; public class OnlineChess : MonoBehaviour { public GameObject DengLuJieMian; public InputField InputText; public Button Zhece; public Text selfName; public Text otherName; public Text typeBy; public ToggleGroup toggleGroup; private Socket socket; private byte[] buffer = new byte[1024]; private string SetText; //——–Chess […]