Skip to content

Instantly share code, notes, and snippets.

View sylviakang's full-sized avatar

Sylvia Kang sylviakang

View GitHub Profile
@sylviakang
sylviakang / Form1.cs
Created September 18, 2025 07:07
2025/09/18:1-3 PictureBox & OpenFileDialog
namespace WinFormsApp1
{
public partial class Form1 : Form
{
PictureBox[] pbArray;
public Form1()
{
InitializeComponent();
pbArray = new PictureBox[] { pictureBox2, pictureBox3, pictureBox4, pictureBox5, pictureBox6 };
}
@sylviakang
sylviakang / Form1.cs
Created March 6, 2025 00:56
Reaction Time Challenge 反應時間挑戰
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp1
{
public partial class Form1: Form
{
private Random rand = new Random();
@sylviakang
sylviakang / Form1.cs
Created March 6, 2025 00:50
Number Guessing Game 猜數字遊戲
using System;
using System.Windows.Forms;
namespace WindowsFormsApp1
{
public partial class Form1: Form
{
private int targetNumber;
private Random rand = new Random();
@sylviakang
sylviakang / Form1.cs
Created March 5, 2025 16:43
Simple Brick Breaker 簡易打磚塊
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace WindowsFormsApp1
{
public partial class Form1: Form
{
private int ballX = 200, ballY = 150, ballSpeedX = 3, ballSpeedY = 3; //set ball start position and moving speed
@sylviakang
sylviakang / counter_provider.dart
Created February 26, 2025 01:39
Flutter 狀態管理
import 'package:flutter/material.dart';
class CounterProvider with ChangeNotifier {
int _count = 0;
int get count => _count;
void increment() {
_count++;
notifyListeners(); // 通知 UI 更新
@sylviakang
sylviakang / answer_button.dart
Last active November 20, 2024 01:42
demo for flutter course 20241113 (project name: fa01)
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
class AnswerButton extends StatelessWidget {
const AnswerButton(
{super.key, required this.answerText, required this.onTap});
final String answerText;
final void Function() onTap;
@override
Widget build(BuildContext context) {
@sylviakang
sylviakang / m373.cpp
Created June 1, 2024 02:53
APCS 202310.4 投資遊戲
#include <bits/stdc++.h>
using namespace std;
int main(){
int n,k,ans = 0;
cin >> n >> k;
vector<vector<int>> dp(k+1,vector<int>(n,0));
vector<int> v(n);
for(int i=0;i<n;i++){
cin >> v[i];
}
@sylviakang
sylviakang / m934.cpp
Created June 1, 2024 02:43
APCS 202401.4 合併成本
#include <bits/stdc++.h>
#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
#define MAXN 105
int c[MAXN][MAXN];
int v[MAXN][MAXN];
signed main(){
fastio;
int n;
while(cin >> n){
@sylviakang
sylviakang / m933.cpp
Created June 1, 2024 02:41
APCS 202401.3 邏輯電路
#include <bits/stdc++.h>
#define int long long
#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
typedef vector<int> vi;
struct node{
int type; // 0:none,1:and,2:or,3:xor,4:not
vi input;
@sylviakang
sylviakang / m372.cpp
Created June 1, 2024 02:32
APCS 202310 m372.3 搬家
#include <bits/stdc++.h>
using namespace std;
struct point{
int r,c;
point(int row,int col){
r = row;
c = col;
}
};
deque<point> qu;