본문 바로가기
반응형

프로그래밍53

Rust로 up down 게임 작성해 보기 rust를 배우고자 처음 작성해본 코드 생각보다 어렵지만 생각보다 쉬움? code block에 rust가 없네 ㅠㅠㅠㅠㅠㅠㅠ use std::io::{self, Write, BufRead}; use rand::Rng; fn selected_number() -> u32 { let mut num_string = String::new(); std::io::stdin() .lock() .read_line(&mut num_string) .expect("error"); let num: u32 = num_string.trim().parse().unwrap(); num } fn main() { let max_try_count: u32 = 10; println!("Up & down: up to 2 digits"); pr.. 2022. 5. 8.
원하는 시간(ms)이 지났는지 확인하는 class class명을 어떻게 지어야 하는지 몰라 그냥 TimeInterval로 지었음 정확하게 interval마다 무언가를 하는 것이 아니라.. interval 이상 지난 후 내가 뭘 해야 할 때 씀 처음 생성시 시간을 넣어주고 CheckInterval()을 계속 호출하면 생성시 넣어준 interval이 지나면 true를 return함 먼저 결과는.. # g++ time_interval.cpp -lgtest -lgtest_main -lpthread # ./a.out Running main() from gtest_main.cc [==========] Running 2 tests from 1 test case. [----------] Global test environment set-up. [----------] .. 2022. 3. 4.
rocksdb sample code on ubuntu 18.04 참고: https://techoverflow.net/2020/01/28/rocksdb-minimal-example-in-c/ RocksDB minimal example in C++ – TechOverflow This minimal example shows how to open a RocksDB database, write a key and how to read it. #include #include #include using namespace std; int main(int argc, char** argv) { rocksdb::DB* db; rocksdb::Options options; options.create_if_missing = true; rocksd techoverflow.net 1. 먼저 ro.. 2022. 2. 27.
[windows] vscode에서 ctrl + / (주석)이 동작하지 않을 때 = 요약 = 한컴 입력기가 선택되어 있는 경우 ctrl + / (주석)이 동작하지 않는다. Microsoft 입력기를 선택하자 (쉽게 변경하는 단축키는 ctrl + shift) 이게 안되는 컴퓨터라면...잘 생각해보면 한글이 깔려 있을 것이다. 주석이 정상 동작 하지 않는 경우라면 아래처럼 되어 있지 않나 확인 한번 해보자 입력기를 아래처럼 바꾸자 2022. 2. 13.
반응형