StartprogrammingusingObjectPascal:ConditionalBranching

From 흡혈양파의 번역工房
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

상태 분기

지능적 장치(컴퓨터나 프로그래밍 가능한 장치와 같은 것)들에게 있어 가장 중요한 것 중 하나는 제각기 다른 상태에 대해 동작을 취하는 것입니다. 이것은 상태 분기를 통해 해결할 수 있습니다. 예를 들어 어떤 차가 속도를 40Km/h 초과하면 문을 닫는다고 합시다. 이 경우의 상태는 다음과 같이 될 것입니다

if Speed is >= 40 and doors are unlocked, then lock door.


자동차, 세탁기, 그리고 다른 수많은 장치들은 마이크로 컨트롤러나 ARM같은 작은 크기의 프로세서처럼 프로그래밍 가능한 회로를 지니고 있습니다. 이러한 회로는 구조에 따라 어셈블리나 C, 프리 파스칼을 사용한 프로그램으로 구성할 수 있습니다.