由买买提看人间百态

topics

全部话题 - 话题: fillcolor
(共0页)
K******g
发帖数: 1870
1
来自主题: JobHunting版 - Amamon onsite 面经
五面的题目和二面很类似啊
int initColor[n][m];
N*M
grid[N][M]
enum color { NO_COLOR=0, GREEN=1, RED=2, ...}
void fillColor(int n, int m, int COLOR)
{
if(n<0 || m<0 || n>N-1 || n>M-1) return;
if(initColor[n][m]!=NO_COLOR && initColor[n][m]!=COLOR) return;

initColor[n][m] = COLOR;
fillColor(n-1, m, COLOR);
fillColor(n, m-1, COLOR);
fillColor(n+1, m, COLOR);
fillColor(n, m+1, COLOR);

}
s*****g
发帖数: 5159
2
Say I have drawn a cube
%%%%%
\begin{pspicture}(0,0)(12,3)
\psframe[linestyle=none,%
fillstyle=solid,%
fillcolor=Apricot]%
(0,0)(2,2)
\pspolygon[linestyle=none,%
fillstyle=solid,%
fillcolor=Tan]%
(0,2)(2,2)(3,3)(1,3)
\pspolygon[linestyle=none,%
fillstyle=solid,%
fillcolor=Mahogany]%
(2,0)(3,1)(3,3)(2,2)
\end{pspicture}
%%%%%
with starts at (0,0) and has a upper right corner of (3,3).
I wish to draw another two cubes looks the same at (4,0) (7,3) and (8,0) (11
,3).
Is there a way for me to use th
S**I
发帖数: 15689
3
\def\myCube{
\psframe[linestyle=none,%
fillstyle=solid,%
fillcolor=Apricot]%
(0,0)(2,2)
\pspolygon[linestyle=none,%
fillstyle=solid,%
fillcolor=Tan]%
(0,2)(2,2)(3,3)(1,3)
\pspolygon[linestyle=none,%
fillstyle=solid,%
fillcolor=Mahogany]%
(2,0)(3,1)(3,3)(2,2)
}
\begin{pspicture}(0,0)(12,3)
\rput(0,0){\myCube}
\rput(4,0){\myCube}
\rput(8,0){\myCube}
\end{pspicture}

11
SAME
G********t
发帖数: 334
4
来自主题: Science版 - slides + pstricks
\documentclass[clock]{slides}
%\usepackage{float}
\usepackage[dvips]{color, graphicx}
\usepackage{pstricks,pst-node,pst-coil,pst-grad}
\begin{document}
\begin{slide}
\textbf{Vibrations of the Linear Symmetric Triatomic Molecule}
\begin{itemize}
\item Symmetric Stretch
\begin{pspicture}(-.5, -.5)%(1, 1)
\cnode[fillstyle=solid,fillcolor=gray](-2.7,-1.5){.3}{A}
\cnode[fillstyle=solid,fillcolor=gray](.0,-1.5){.3}{B}
\cnode[fillstyle=solid,fillcolor=gray](2.7,-1.5){.3}{C}
\nccoil[
d**********o
发帖数: 1321
5
来自主题: WebRadio版 - 潜水员冒泡兼征版友意见
我与Emacs的不解情缘(9)
差不多去年暑假后回学期也学会了自己写macro,贴个前段时间做题时写过的写lc的模
板吧:M-x lc ENT :
(fset 'lc
[?# ?i ?n ?c ?l ?u ?d ?e ? ?< ?i ?o ?s ?t ?r ?e ?a ?m ?> return ?# ?i ?n
?c ?l ?u ?d ?e ? ?< ?v ?e ?c ?t ?o ?r ?> return ?# ?i ?n ?c ?l ?u ?d ?e ?
?< ?a ?l ?g ?o ?r ?i ?t ?h ?m ?> return ?# ?i ?n ?c ?l ?u ?d ?e ? ?< ?c ?s
?t ?r ?i ?n ?g ?> return ?# ?i ?n ?c ?l ?u ?d ?e ? ?< ?c ?m ?a ?t ?h ?>
return ?# ?i ?n ?c ?l ?u ?d ?e ? ?< ?s ?t ?a ?c ?k ?> return ?# ?i ?n ?c ?l
?u ?d ?e ? ?< ?q ?u ?e ?u ?e ?> retur... 阅读全帖
d**********o
发帖数: 1321
6
来自主题: WebRadio版 - 潜水员冒泡兼征版友意见
我与Emacs的不解情缘(9)
差不多去年暑假后回学期也学会了自己写macro,贴个前段时间做题时写过的写lc的模
板吧:M-x lc ENT :
(fset 'lc
[?# ?i ?n ?c ?l ?u ?d ?e ? ?< ?i ?o ?s ?t ?r ?e ?a ?m ?> return ?# ?i ?n
?c ?l ?u ?d ?e ? ?< ?v ?e ?c ?t ?o ?r ?> return ?# ?i ?n ?c ?l ?u ?d ?e ?
?< ?a ?l ?g ?o ?r ?i ?t ?h ?m ?> return ?# ?i ?n ?c ?l ?u ?d ?e ? ?< ?c ?s
?t ?r ?i ?n ?g ?> return ?# ?i ?n ?c ?l ?u ?d ?e ? ?< ?c ?m ?a ?t ?h ?>
return ?# ?i ?n ?c ?l ?u ?d ?e ? ?< ?s ?t ?a ?c ?k ?> return ?# ?i ?n ?c ?l
?u ?d ?e ? ?< ?q ?u ?e ?u ?e ?> retur... 阅读全帖
(共0页)