Skip to content

Instantly share code, notes, and snippets.

View WideWord's full-sized avatar

Kirill Vilkov WideWord

View GitHub Profile
org 100h
jmp main
include 'proc16.inc'
main:
stdcall get_arg, .buffer, 64
sub sp, 2
call read_int
call fib
call write_int
add sp, 2
ret
fib: ; (word) -> word
push bp
Каждая команда занимает 1 байт
и имеет формат: (по битам)
1 операнд
CCCCCAAA
0 операндов
CCCCCCCC
где С - биты оператора, A - биты операнда
Список команд:
org 0x100
push enter_number_msg
call write_str
add sp, 2
push 0
call read_int
pop ax
animclocks<-function(a1,b1,a2,b2){
saveHTML({
ani.options(interval=0.04)
png(ani.options("img.fmt"))
dev.off()
},img.name="Y",ani.type='png',
htmlfile="Y.html",imgdir="ImageHTML",autoplay=FALSE,
interval=0.04,title="TestHTML")
}
;launch main process
:init
set sp, 0xC400
set [processTable], 0xC400
set z, 0xFFFF
hwn i
set j, 0
:init_loop

Написать функцию:

Ввод: f(x)

Вывод:

  1. f(x) = 0 при x
  2. f'(x) = ...
  3. Предпологаемые точки экстремума
--> game();
1 - human vs human, 2 - human vs ai: 2
###
###
###
player 1 turn: [1 1]
X##
###
###
player 2 (ai) turn
package main
import("./vk")
var client *vk.Client
func main() {
client = vk.NewClient()
client.AuthServer("1234", "5678")
func AuthAppVk(id, secret string) (auth VkAuth, err error) {
auth = VkAuth("")
url := fmt.Sprintf("https://oauth.vk.com/access_token?client_id=%s&client_secret=%secret&v=5.24&grant_type=client_credentials")
resp, err := http.Get(url)
if err != nil { return }
defer resp.Body.Close()